autouse.t uses B as a random test XS module which it can defer loading.
However, B recently changed to not use Exporter, which upsets autouse:
but *only* when running under 't/TEST -deparse'. I'm not sure why it only
fails then, but in any case, this commit changes it so that it uses
Hash::Util instead.
SKIP: {
skip "Fails in 5.15.5 and below (perl bug)", 1 if $] < 5.0150051;
use Config;
SKIP: {
skip "Fails in 5.15.5 and below (perl bug)", 1 if $] < 5.0150051;
use Config;
- skip "no B", 1 unless $Config{extensions} =~ /\bB\b/;
+ skip "no Hash::Util", 1 unless $Config{extensions} =~ /\bHash::Util\b/;
use warnings; local $^W = 1; no warnings 'once';
my $w;
local $SIG{__WARN__} = sub { $w .= shift };
use warnings; local $^W = 1; no warnings 'once';
my $w;
local $SIG{__WARN__} = sub { $w .= shift };
- use autouse B => "sv_undef";
- *B::sv_undef = \&sv_undef;
- require B;
+ # any old XS sub from any old module which uses Exporter
+ use autouse 'Hash::Util' => "all_keys";
+ *Hash::Util::all_keys = \&all_keys;
+ require Hash::Util;
is $w, undef,
'no redefinition warning when clobbering autouse stub with new XSUB';
}
is $w, undef,
'no redefinition warning when clobbering autouse stub with new XSUB';
}