X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F17-ctl.t;h=a7557aeb6567ecc6e6497071bf657bf199651c33;hb=ace906d7e76ed647adbd1ab1243ac9bdbde9b1d5;hp=ded9d6349d6fe329d8beee693d30cac1bae1d5e2;hpb=6e42ee234deb79fad1c91703e5a7ec3bd8bc47f3;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/17-ctl.t b/t/17-ctl.t index ded9d63..a7557ae 100644 --- a/t/17-ctl.t +++ b/t/17-ctl.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 7; +use Test::More tests => 10 + 1; use Variable::Magic qw/wizard cast/; @@ -74,3 +74,17 @@ eval q{BEGIN { }}; like $@, qr/pepperoni/, 'die in len callback in BEGIN'; + +use lib 't/lib'; +eval "use Variable::Magic::TestScopeEnd"; + +like $@, qr/turnip/, 'die in BEGIN in require triggers hints hash destructor'; + +eval q{BEGIN { + Variable::Magic::TestScopeEnd::hook { + pass 'in hints hash destructor 2'; + }; + die "tomato"; +}}; + +like $@, qr/tomato/, 'die in BEGIN in eval triggers hints hash destructor';