X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FScalar-Vec-Util.git;a=blobdiff_plain;f=t%2F21-vfill.t;h=47026688f04636d7b9b1fed3a48acdd1e8bf7e95;hp=33565f954bcb9b89adee5a838ad396a25ef0019c;hb=607607c4f5ec537ba56acb4edc424bc71900517a;hpb=dec1755eec42f54c4d57813ed03393c0f765a699 diff --git a/t/21-vfill.t b/t/21-vfill.t index 33565f9..4702668 100644 --- a/t/21-vfill.t +++ b/t/21-vfill.t @@ -7,14 +7,12 @@ use Test::More 'no_plan'; use Scalar::Vec::Util qw/vfill SVU_SIZE/; -eval { vfill undef, 0, 0, 0 }; -like($@, qr/Invalid\s+argument/, 'first argument undef croaks'); -eval { vfill my $x, undef, 0, 0 }; -like($@, qr/Invalid\s+argument/, 'second argument undef croaks'); -eval { vfill my $x, 0, undef, 0 }; -like($@, qr/Invalid\s+argument/, 'third argument undef croaks'); -eval { vfill my $x, 0, 0, undef }; -like($@, qr/Invalid\s+argument/, 'fourth argument undef croaks'); +for ([ 1, 'offset', -1 ], [ 2, 'length', '-1' ]) { + my @args = (~0) x 4; + $args[$_->[0]] = $_->[2]; + eval { &vfill(@args) }; my $line = __LINE__; + like $@, qr/^Invalid\s+negative\s+$_->[1]\s+at\s+\Q$0\E\s+line\s+$line/; +} my $p = SVU_SIZE; $p = 8 if $p < 8;