X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FScalar-Vec-Util.git;a=blobdiff_plain;f=t%2F10-veq-pp.t;h=509fd98f3cba1989c96a62681e9f0e1535340961;hp=98fea99ad69657588fef72c64396bc3d5b300d82;hb=607607c4f5ec537ba56acb4edc424bc71900517a;hpb=dec1755eec42f54c4d57813ed03393c0f765a699 diff --git a/t/10-veq-pp.t b/t/10-veq-pp.t index 98fea99..509fd98 100644 --- a/t/10-veq-pp.t +++ b/t/10-veq-pp.t @@ -7,16 +7,12 @@ use Test::More 'no_plan'; use Scalar::Vec::Util; -eval { Scalar::Vec::Util::veq_pp(undef, 0, my $y, 0, 0) }; -like($@, qr/Invalid\s+argument/, 'first argument undef croaks'); -eval { Scalar::Vec::Util::veq_pp(my $x, undef, my $y, 0, 0) }; -like($@, qr/Invalid\s+argument/, 'second argument undef croaks'); -eval { Scalar::Vec::Util::veq_pp(my $x, 0, undef, 0, 0) }; -like($@, qr/Invalid\s+argument/, 'third argument undef croaks'); -eval { Scalar::Vec::Util::veq_pp(my $x, 0, my $y, undef, 0) }; -like($@, qr/Invalid\s+argument/, 'fourth argument undef croaks'); -eval { Scalar::Vec::Util::veq_pp(my $x, 0, my $y, 0, undef) }; -like($@, qr/Invalid\s+argument/, 'fifth argument undef croaks'); +for ([ 1, 'offset', -1 ], [ 3, 'offset', '-1' ], [ 4, 'length', -1 ]) { + my @args = ('1') x 5; + $args[$_->[0]] = $_->[2]; + eval { &Scalar::Vec::Util::veq_pp(@args) }; my $line = __LINE__; + like $@, qr/^Invalid\s+negative\s+$_->[1]\s+at\s+\Q$0\E\s+line\s+$line/; +} my $p = 8; my $n = 3 * $p;