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>;
+
+use lib 't/lib';
+use Variable::Magic::TestGlobalDestruction;
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');
ok($res, 're-re-cast on self is valid');
}
-# is($c, 0, 'magic destructor is called');
+eval q[
+ use lib 't/lib';
+ BEGIN { require Variable::Magic::TestDestroyRequired; }
+];
+is $@, '', 'wizard destruction at the end of BEGIN-time require doesn\'t panic';