]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - t/41-clone.t
Fix the B stashes cache cloning, and really use it for blessing op objects
[perl/modules/Variable-Magic.git] / t / 41-clone.t
index 90f15e0fc08fceb517af25711869b441f1862524..e410f88888396122ed5df51804b03f60ea317bfc 100644 (file)
@@ -40,10 +40,15 @@ sub spawn_wiz {
   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 $op = $_[-1];
                      my $tid = threads->tid();
-                     is $name, 'sassign', "opname for op_info $op_info in thread $tid is correct";
+                     if ($op_info == VMG_OP_INFO_OBJECT) {
+                      is_deeply { class => ref($op),   name => $op->name },
+                                { class => 'B::BINOP', name => 'sassign' },
+                                "op object in thread $tid is correct";
+                     } else {
+                      is $op, 'sassign', "op name in thread $tid is correct";
+                     }
                      0
                     },
          free    => sub { ++$destroyed; 0 },