7 use Test::Leaner 'no_plan';
9 use Scalar::Vec::Util qw<vcopy SVU_SIZE>;
12 *myfill = *Scalar::Vec::Util::vfill_pp;
13 *myeq = *Scalar::Vec::Util::veq_pp;
16 for ([ 1, 'offset', -1 ], [ 3, 'offset', -1 ], [ 4, 'length', -1 ]) {
18 $args[$_->[0]] = $_->[2];
20 eval { &vcopy(@args) };
22 my $line = __LINE__-2;
23 like $err, qr/^Invalid\s+negative\s+$_->[1]\s+at\s+\Q$0\E\s+line\s+$line/,
24 "vcopy(@args) failed";
33 myfill $_[0], 0, $n, 0;
38 my (undef, $a, $b, $x) = @_;
41 myfill $_[0], 0, $a, $x;
42 myfill $_[0], $a, $b, 1 - $x;
46 my ($f, $t, $c) = ('') x 3;
48 my @s = ($p - $q) .. ($p + $q);
51 for my $l (0 .. $n - 1) {
52 my $desc = "vcopy $s1, $s2, $l";
56 vcopy $f => $s1, $t => $s2, $l;
57 is length $t, length $c, "$desc: length";
58 ok myeq($t, 0, $c, 0, $n), "$desc: bits";