+sub spawn_wiz {
+ my ($op_info) = @_;
+
+ my $wiz = eval {
+ wizard data => sub { $_[1] + threads->tid() },
+ get => sub { ++$c; 0 },
+ set => sub {
+ my $name = $_[-1];
+ $name = $name->name if $op_info == VMG_OP_INFO_OBJECT;
+ my $tid = threads->tid();
+ is $name, 'sassign', "opname for op_info $op_info in thread $tid is correct";
+ 0
+ },
+ free => sub { ++$destroyed; 0 },
+ op_info => $op_info
+ };
+ is($@, '', "wizard with op_info $op_info in main thread doesn't croak");
+ isnt($wiz, undef, "wizard with op_info $op_info in main thread is defined");
+ is($c, 0, "wizard with op_info $op_info in main thread doesn't trigger magic");
+
+ return $wiz;
+}