]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - t/15-self.t
Properly unmortalize the wizard after removing it from the global hash
[perl/modules/Variable-Magic.git] / t / 15-self.t
index 700cb17d714ff582cc1a850053f31731cef5e244..504c4b217bfb46499b8bb0c321d87534df07d47b 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 16;
+use Test::More tests => 17;
 
 use Variable::Magic qw/wizard cast dispell getdata getsig/;
 
@@ -50,9 +50,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');