summaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2017-11-22 17:38:42 +0000
committerDavid Mitchell <davem@iabyn.com>2017-11-23 08:52:16 +0000
commit202e69b0dde4e2b9af75287d72bbaf6ef977d278 (patch)
treecea2300809783c2573e39fa3f7d18763edfb8055 /dist
parent66cc68c1258a92d08e8c1362720c1d80eb52b063 (diff)
downloadperl-202e69b0dde4e2b9af75287d72bbaf6ef977d278.tar.gz
autouse: fix autouse.t deparsing
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.
Diffstat (limited to 'dist')
-rw-r--r--dist/autouse/t/autouse.t9
1 files changed, 5 insertions, 4 deletions
diff --git a/dist/autouse/t/autouse.t b/dist/autouse/t/autouse.t
index a790403f0f..20ad9eb8d4 100644
--- a/dist/autouse/t/autouse.t
+++ b/dist/autouse/t/autouse.t
@@ -98,13 +98,14 @@ SKIP: {
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 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';
}