]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - t/35-stash.t
This is 0.64
[perl/modules/Variable-Magic.git] / t / 35-stash.t
index 2dd9f44d8de1140239f6728648ff9ee2d05abd5a..a9600bc44d3f6b1a73e6ec5282fb706fcb5166ec 100644 (file)
@@ -92,11 +92,19 @@ cast %Hlagh::, $wiz;
  };
 
  my @calls = qw<eat shoot leave roam yawn roam>;
+ my (@fetch, @store);
+ if ("$]" >= 5.011_002 && "$]" < 5.021_004) {
+  @fetch = @calls;
+  @store = map { ($_) x 2 } @calls;
+ } else {
+  @fetch = @calls;
+  @store = @calls;
+ }
 
  is $@, "ok\n", 'stash: function calls compiled fine';
  is_deeply \%mg, {
-  fetch => \@calls,
-  store => ("$]" < 5.011_002 ? \@calls : [ map { ($_) x 2 } @calls ]),
+  fetch => \@fetch,
+  store => \@store,
  }, 'stash: function calls';
 }
 
@@ -106,9 +114,12 @@ cast %Hlagh::, $wiz;
  eval q{ Hlagh->shoot() };
 
  is $@, '', 'stash: valid method call ran fine';
- is_deeply \%mg, {
-  fetch => [ qw<shoot> ],
- }, 'stash: valid method call';
+ my %expected = ( fetch => [ qw<shoot> ] );
+ # Typeglob reification may cause a store in 5.28+
+ if ("$]" >= 5.027 && %mg == 2) {
+  $expected{store} = $expected{fetch};
+ }
+ is_deeply \%mg, \%expected, 'stash: valid method call';
 }
 
 {
@@ -296,7 +307,7 @@ $_ => sub {
 CB
 } qw<fetch store exists delete>);
 
-my $uo_exp = "$]" < 5.011_002 ? 2 : 3;
+my $uo_exp = "$]" >= 5.011_002 && "$]" < 5.021_004 ? 3 : 2;
 
 $code .= ', data => sub { +{ guard => 0 } }';