};
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.011002 ? \@calls : [ map { ($_) x 2 } @calls ]),
+ fetch => \@fetch,
+ store => \@store,
}, 'stash: function calls';
}
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';
}
{
{
local %mg;
+ my @expected_stores = qw<nevermentioned eat shoot>;
+ @expected_stores = map { ($_) x 2 } @expected_stores if "$]" < 5.017_004;
+ push @expected_stores, 'nevermentioned' if "$]" < 5.017_001;
+
eval q{
package Hlagh;
undef &nevermentioned;
};
is $@, '', 'stash: delete executed fine';
- is_deeply \%mg, {
- store => [
- qw<nevermentioned nevermentioned eat eat shoot shoot nevermentioned>
- ],
- }, 'stash: delete';
+ is_deeply \%mg, { store => \@expected_stores }, 'stash: delete';
}
END {
CB
} qw<fetch store exists delete>);
-my $uo_exp = "$]" < 5.011002 ? 2 : 3;
+my $uo_exp = "$]" >= 5.011_002 && "$]" < 5.021_004 ? 3 : 2;
$code .= ', data => sub { +{ guard => 0 } }';