]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - t/41-clone.t
t/41-clone.t needs to call wizard into an eval block
[perl/modules/Variable-Magic.git] / t / 41-clone.t
index 032fa92d3b85e8072406322700b9e7e5e211a457..71e090f0419c3cce701882ac59d24bbd4da5e33b 100644 (file)
@@ -29,9 +29,11 @@ if (VMG_THREADSAFE) {
 
 my $destroyed : shared = 0;
 my $c         : shared = 0;
-my $wiz = wizard get  => sub { ++$c },
-                 data => sub { $_[1] + threads->tid() },
-                 free => sub { ++$destroyed };
+my $wiz = eval {
+ wizard get  => sub { ++$c },
+        data => sub { $_[1] + threads->tid() },
+        free => sub { ++$destroyed }
+};
 is($@,     '',    "wizard in main thread doesn't croak");
 isnt($wiz, undef, "wizard in main thread is defined");
 is($c,     0,     "wizard in main thread doesn't trigger magic");