6 use Test::More 'no_plan';
8 use Scalar::Vec::Util qw/vcopy SVU_SIZE/;
10 eval { vcopy undef, 0, my $y, 0, 0 };
11 like($@, qr/Invalid\s+argument/, 'first argument undef croaks');
12 eval { vcopy my $x, undef, my $y, 0, 0 };
13 like($@, qr/Invalid\s+argument/, 'second argument undef croaks');
14 eval { vcopy my $x, 0, undef, 0, 0 };
15 like($@, qr/Invalid\s+argument/, 'third argument undef croaks');
16 eval { vcopy my $x, 0, my $y, undef, 0 };
17 like($@, qr/Invalid\s+argument/, 'fourth argument undef croaks');
18 eval { vcopy my $x, 0, my $y, 0, undef };
19 like($@, qr/Invalid\s+argument/, 'fifth argument undef croaks');
26 *myfill = *Scalar::Vec::Util::vfill_pp;
27 *myeq = *Scalar::Vec::Util::veq_pp;
29 sub rst { myfill($_[0], 0, $n, 0); $_[0] = '' }
32 (undef, my $a, my $b, my $x) = @_;
35 myfill($_[0], 0, $a, $x);
36 myfill($_[0], $a, $b, 1 - $x);
40 my ($f, $t, $c) = ('') x 3;
42 my @s = ($p - $q) .. ($p + $q);
45 for my $l (0 .. $n - 1) {
46 last if $s1 + $l > $n or $s2 + $l > $n;
50 vcopy $f => $s1, $t => $s2, $l;
51 ok(myeq($t, 0, $c, 0, $n), "vcopy $s1, $s2, $l");
52 is(length $t, length $c, "length is ok");