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");