use strict;
use warnings;
-use Test::More tests => 7;
+use Test::More tests => 11;
-use Variable::Magic qw/wizard cast getdata/;
+use Variable::Magic qw<wizard cast getdata>;
our $destroyed;
is $destroyed, 1;
}
+
+{
+ local $destroyed = 0;
+
+ {
+ my $obj = D->new;
+
+ {
+ my $w = wizard set => $obj;
+
+ {
+ my $x = 1;
+ cast $x, $w;
+ is $destroyed, 0;
+ }
+
+ is $destroyed, 0;
+ }
+
+ is $destroyed, 0;
+ }
+
+ is $destroyed, 1;
+}