X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F15-self.t;h=cfca7080faaabace5c1b0732dd9b6a96494654e6;hb=90ca07f2bcc731f8a3118fecdfffbd8975686eaa;hp=700cb17d714ff582cc1a850053f31731cef5e244;hpb=b85f6ded9d3d67458fd9e3f37e0367d446e85d6a;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/15-self.t b/t/15-self.t index 700cb17..cfca708 100644 --- a/t/15-self.t +++ b/t/15-self.t @@ -3,9 +3,9 @@ use strict; use warnings; -use Test::More tests => 16; +use Test::More tests => 17; -use Variable::Magic qw/wizard cast dispell getdata getsig/; +use Variable::Magic qw/wizard cast dispell getdata/; my $c = 0; @@ -39,7 +39,6 @@ my $c = 0; $w = getdata $wiz, $wiz; is($c, 1, 'getdata on magical self doesn\'t trigger callbacks'); - # is(getsig($w), getsig($wiz), 'getdata returns the correct wizard'); $res = eval { dispell $wiz, $wiz }; is($@, '', 're-dispell on self doesn\'t croak'); @@ -50,9 +49,13 @@ my $c = 0; ok($res, 're-re-cast on self is valid'); } +eval q[ + use lib 't/lib'; + BEGIN { require Variable::Magic::TestDestroyRequired; } +]; +is $@, '', 'wizard destruction at the end of BEGIN-time require doesn\'t panic'; + if ((defined $ENV{PERL_DESTRUCT_LEVEL} and $ENV{PERL_DESTRUCT_LEVEL} >= 3) or eval "use Perl::Destruct::Level level => 3; 1") { diag 'Test global destruction'; } - -# is($c, 0, 'magic destructor is called');