6 use Test::More 'no_plan';
8 use Scalar::Vec::Util qw<vfill SVU_SIZE>;
11 *myfill = *Scalar::Vec::Util::vfill_pp;
12 *myeq = *Scalar::Vec::Util::veq_pp;
15 for ([ 1, 'offset', -1 ], [ 2, 'length', '-1' ]) {
17 $args[$_->[0]] = $_->[2];
19 eval { &vfill(@args) };
21 my $line = __LINE__-2;
22 like $err, qr/^Invalid\s+negative\s+$_->[1]\s+at\s+\Q$0\E\s+line\s+$line/,
23 "vfill(@args) failed";
32 myfill $_[0], 0, $n, 0;
37 my (undef, $a, $b, $x) = @_;
40 myfill $_[0], 0, $a, $x;
41 myfill $_[0], $a, $b, 1 - $x;
45 my ($v, $c) = ('') x 2;
47 my @s = ($p - $q) .. ($p + $q);
49 for my $l (0 .. $n - 1) {
51 my $desc = "vfill $s, $l";
55 is length $v, length $c, "$desc: length";
56 ok myeq($v, 0, $c, 0, $n), "$desc: bits";