X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F18-opinfo.t;fp=t%2F18-opinfo.t;h=c10ccb063cf0e1cdd300f3348d263ac7858fffc4;hb=7d7ecf0199c007b554b0d8297c1486edfcb99464;hp=12313f877f6f103bea8bf7e6442917537b8f4569;hpb=eca9d54dfe50df3daace0c4aa552289258cf6c68;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/18-opinfo.t b/t/18-opinfo.t index 12313f8..c10ccb0 100644 --- a/t/18-opinfo.t +++ b/t/18-opinfo.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 11 * (5 + 6) + 5; +use Test::More tests => 11 * (5 + 6) + 4 + 5; use Config qw/%Config/; @@ -76,6 +76,25 @@ for (@tests) { } } +{ + my $c; + + my $op_info = VMG_OP_INFO_OBJECT; + my $wiz = eval { + wizard free => sub { + my $op = $_[-1]; + my $desc = "free magic with op_info == $op_info"; + isa_ok $op, 'B::OP', $desc; + is $op->name, 'leaveloop', "$desc gets the right op info"; + (); + }, op_info => $op_info; + }; + is $@, '', "get wizard with out of bounds op_info doesn't croak"; + + eval { cast $c, $wiz }; + is $@, '', "get cast with out of bounds op_info doesn't croak"; +} + { my $c;