X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F12-sig.t;h=057558436b6ee2a41e573d8f52a73d8ca52c312f;hb=eb15f22f761b72aa1a6fc282ffcaf4326a3ae08d;hp=7f8ff2c68ae72a89467ab6dc7f882d3bc60212ba;hpb=c2588a284fafc441108ad2505f786dfa74de4d70;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/12-sig.t b/t/12-sig.t index 7f8ff2c..0575584 100644 --- a/t/12-sig.t +++ b/t/12-sig.t @@ -11,6 +11,8 @@ my $sig = 300; my ($a, $b, $c, $d) = 1 .. 4; +my $inv_num_sig = qr/Invalid\s+numeric\s+signature\s+at\s+\Q$0\E/; + { my $wiz = eval { wizard sig => $sig }; is($@, '', 'wizard creation doesn\'t croak'); @@ -25,16 +27,16 @@ my ($a, $b, $c, $d) = 1 .. 4; is($sig, getsig $wiz2, 'retrieved wizard signature is correct'); my $wiz3 = eval { wizard sig => [ ] }; - like($@, qr/Invalid\s+numeric\s+signature\s+at\s+\Q$0\E/, 'non numeric signature croaks'); - is($wiz3, undef, 'non numeric signature doesn\'t return anything'); + like($@, $inv_num_sig, 'non numeric signature croaks'); + is($wiz3, undef, 'non numeric signature doesn\'t return anything'); $wiz3 = eval { wizard sig => SIG_MIN - 1 }; - like($@, qr/Invalid\s+numeric\s+signature\s+at\s+\Q$0\E/, 'numeric signature too small croaks'); - is($wiz3, undef, 'numeric signature too small doesn\'t return anything'); + like($@, $inv_num_sig, 'numeric signature too small croaks'); + is($wiz3, undef, 'numeric signature too small doesn\'t return anything'); $wiz3 = eval { wizard sig => SIG_MAX + 1 }; - like($@, qr/Invalid\s+numeric\s+signature\s+at\s+\Q$0\E/, 'numeric signature too big croaks'); - is($wiz3, undef, 'numeric signature too big doesn\'t return anything'); + like($@, $inv_num_sig, 'numeric signature too big croaks'); + is($wiz3, undef, 'numeric signature too big doesn\'t return anything'); my $a = 1; my $res = eval { cast $a, $wiz };