X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F17-ctl.t;h=a7557aeb6567ecc6e6497071bf657bf199651c33;hb=90ca07f2bcc731f8a3118fecdfffbd8975686eaa;hp=ce22ea6d93d37405d1c39e6943848486fefd9b76;hpb=fbcb2462798d2fa931a5c97ebf0cec73177dce23;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/17-ctl.t b/t/17-ctl.t index ce22ea6..a7557ae 100644 --- a/t/17-ctl.t +++ b/t/17-ctl.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 8 + 1; +use Test::More tests => 10 + 1; use Variable::Magic qw/wizard cast/; @@ -76,6 +76,15 @@ eval q{BEGIN { like $@, qr/pepperoni/, 'die in len callback in BEGIN'; use lib 't/lib'; -eval "use Variable::Magic::TestDieRequired"; +eval "use Variable::Magic::TestScopeEnd"; -like $@, qr/turnip/, 'die in required with localized hash gets the right error message'; +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';