]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - t/40-threads.t
Fix the B stashes cache cloning, and really use it for blessing op objects
[perl/modules/Variable-Magic.git] / t / 40-threads.t
index 6fb1d36a6a743893ce766e2eef839b6ed4b54b21..0b16c6aeb44acc8e18a4ae81ef2b055acb7d57dd 100644 (file)
@@ -41,9 +41,14 @@ sub try {
          sig     => $sig,
          get     => sub { ++$c; 0 },
          set     => sub {
-                     my $name = $_[-1];
-                     $name = $name->name if $op_info == VMG_OP_INFO_OBJECT;
-                     is $name, 'sassign', "opname for op_info $op_info in thread $tid is correct";
+                     my $op = $_[-1];
+                     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 },