]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - t/14-callbacks.t
Bless the op info object into the right class (stealing the logic from B)
[perl/modules/Variable-Magic.git] / t / 14-callbacks.t
index eae92fd0ac60c4d27bb899d18242ae56a7d17ca2..1f2c2de6c62a64b65ce3a2842f573000cc9a7158 100644 (file)
@@ -65,7 +65,8 @@ is_deeply(\@callers, [
  ([ 'main', $0, __LINE__-3 ]) x 2,
 ], 'caller into callback into eval returns the right thing');
 
-for ([ 'get', '$c', 'sassign' ], [ 'len', '@c', 'padav' ]) {
+for ([ 'get', '$c', [ 'sassign', 'B::BINOP' ] ],
+     [ 'len', '@c', [ 'padav',   'B::OP'    ] ]) {
  my ($key, $var, $exp) = @$_;
 
  for my $op_info (VMG_OP_INFO_NAME, VMG_OP_INFO_OBJECT, 3) {
@@ -79,10 +80,10 @@ for ([ 'get', '$c', 'sassign' ], [ 'len', '@c', 'padav' ]) {
     my $op = $_[-1];
     my $desc = "$key magic with op_info == $op_info";
     if ($op_info == 1) {
-     is $op, $exp, "$desc gets the right op info";
+     is $op, $exp->[0], "$desc gets the right op info";
     } elsif ($op_info == 2) {
-     isa_ok $op, 'B::OP', $desc;
-     is $op->name, $exp, "$desc gets the right op info";
+     isa_ok $op, $exp->[1], $desc;
+     is $op->name, $exp->[0], "$desc gets the right op info";
     } else {
      is $op, undef, "$desc gets the right op info";
     }