X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F35-stash.t;h=a9600bc44d3f6b1a73e6ec5282fb706fcb5166ec;hb=f55eedad251ca6351a00c8014eb9ab64b800b4af;hp=9d094ea57d3e2cbbcc3096e89d97675160c2b19c;hpb=31d52b1760f1736186f4652cacb3636e4f96f3ba;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/35-stash.t b/t/35-stash.t index 9d094ea..a9600bc 100644 --- a/t/35-stash.t +++ b/t/35-stash.t @@ -93,14 +93,11 @@ cast %Hlagh::, $wiz; my @calls = qw; my (@fetch, @store); - if ("$]" < 5.011_002) { - @fetch = @calls; - @store = @calls; - } elsif ("$]" < 5.021_004) { + if ("$]" >= 5.011_002 && "$]" < 5.021_004) { @fetch = @calls; @store = map { ($_) x 2 } @calls; } else { - @fetch = map { ($_) x 2 } @calls; + @fetch = @calls; @store = @calls; } @@ -117,9 +114,12 @@ cast %Hlagh::, $wiz; eval q{ Hlagh->shoot() }; is $@, '', 'stash: valid method call ran fine'; - is_deeply \%mg, { - fetch => [ qw ], - }, 'stash: valid method call'; + my %expected = ( fetch => [ qw ] ); + # 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'; } { @@ -307,7 +307,7 @@ $_ => sub { CB } qw); -my $uo_exp = "$]" < 5.011_002 ? 2 : 3; +my $uo_exp = "$]" >= 5.011_002 && "$]" < 5.021_004 ? 3 : 2; $code .= ', data => sub { +{ guard => 0 } }';