6 use Test::More 'no_plan';
8 use Scalar::Vec::Util qw/vfill SVU_SIZE/;
10 eval { vfill undef, 0, 0, 0 };
11 like($@, qr/Invalid\s+argument/, 'first argument undef croaks');
12 eval { vfill my $x, undef, 0, 0 };
13 like($@, qr/Invalid\s+argument/, 'second argument undef croaks');
14 eval { vfill my $x, 0, undef, 0 };
15 like($@, qr/Invalid\s+argument/, 'third argument undef croaks');
16 eval { vfill my $x, 0, 0, undef };
17 like($@, qr/Invalid\s+argument/, 'fourth argument undef croaks');
24 *myfill = *Scalar::Vec::Util::vfill_pp;
25 *myeq = *Scalar::Vec::Util::veq_pp;
27 sub rst { myfill($_[0], 0, $n, 0); $_[0] = '' }
30 (undef, my $a, my $b, my $x) = @_;
33 myfill($_[0], 0, $a, $x);
34 myfill($_[0], $a, $b, 1 - $x);
38 my ($v, $c) = ('') x 2;
40 my @s = ($p - $q) .. ($p + $q);
42 for my $l (0 .. $n - 1) {
47 ok(myeq($v, 0, $c, 0, $n), "vfill $s, $l");
48 is(length $v, length $c, "length is ok");