summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <leonerd@leonerd.org.uk>2021-12-03 18:03:57 +0000
committerPaul Evans <leonerd@leonerd.org.uk>2021-12-08 14:31:17 +0000
commitb9f7c4e2d12179801bb3a33af15aa343bb9d71db (patch)
tree9cdcee9b0a2794ad07434468e9ab0f30293d27ca
parent8d55e914e048b6646b2bafaaec296b12a92335f3 (diff)
downloadperl-b9f7c4e2d12179801bb3a33af15aa343bb9d71db.tar.gz
Use builtin::weaken() in .t files in lib/ + ext/
-rw-r--r--ext/Hash-Util-FieldHash/t/05_perlhook.t2
-rw-r--r--ext/XS-APItest/t/hash.t2
-rw-r--r--ext/XS-APItest/t/magic.t1
-rw-r--r--lib/B/Deparse.t5
-rw-r--r--lib/overload.t2
5 files changed, 5 insertions, 7 deletions
diff --git a/ext/Hash-Util-FieldHash/t/05_perlhook.t b/ext/Hash-Util-FieldHash/t/05_perlhook.t
index ab3d74ba57..7b5990998d 100644
--- a/ext/Hash-Util-FieldHash/t/05_perlhook.t
+++ b/ext/Hash-Util-FieldHash/t/05_perlhook.t
@@ -4,7 +4,7 @@ use Test::More;
my $n_tests;
use Hash::Util::FieldHash;
-use Scalar::Util qw( weaken);
+use builtin qw(weaken);
sub numbers_first { # Sort helper: All digit entries sort in front of others
# Makes sorting portable across ASCII/EBCDIC
diff --git a/ext/XS-APItest/t/hash.t b/ext/XS-APItest/t/hash.t
index 5d3357e888..e502e705ba 100644
--- a/ext/XS-APItest/t/hash.t
+++ b/ext/XS-APItest/t/hash.t
@@ -191,7 +191,7 @@ sub test_precomputed_hashes {
}
{
- use Scalar::Util 'weaken';
+ use builtin 'weaken';
my %h;
fill_hash_with_nulls(\%h);
my @objs;
diff --git a/ext/XS-APItest/t/magic.t b/ext/XS-APItest/t/magic.t
index e47cd887cb..46feb7ab07 100644
--- a/ext/XS-APItest/t/magic.t
+++ b/ext/XS-APItest/t/magic.t
@@ -29,7 +29,6 @@ ok !mg_find_bar($sv), '... and bar magic is removed too';
is(test_get_vtbl(), 0, 'get_vtbl(-1) returns NULL');
-use Scalar::Util 'weaken';
eval { sv_magic(\!0, $foo) };
is $@, "", 'PERL_MAGIC_ext is permitted on read-only things';
diff --git a/lib/B/Deparse.t b/lib/B/Deparse.t
index e6c01e3c80..0d471c5362 100644
--- a/lib/B/Deparse.t
+++ b/lib/B/Deparse.t
@@ -413,9 +413,8 @@ like runperl(stderr => 1, switches => [ '-MO=-qq,Deparse', $path ],
qr/sub f\s*\(\$\)\s*\{\s*\}/,
'predeclared prototyped subs';
like runperl(stderr => 1, switches => [ '-MO=-qq,Deparse', $path ],
- prog => 'use Scalar::Util q-weaken-;
- sub f($);
- BEGIN { weaken($_=\$::{f}) }'),
+ prog => 'sub f($);
+ BEGIN { use builtin q-weaken-; weaken($_=\$::{f}) }'),
qr/sub f\s*\(\$\)\s*;/,
'prototyped stub with weak reference to the stash entry';
like runperl(stderr => 1, switches => [ '-MO=-qq,Deparse', $path ],
diff --git a/lib/overload.t b/lib/overload.t
index 1a641a2863..be88fb8148 100644
--- a/lib/overload.t
+++ b/lib/overload.t
@@ -1390,7 +1390,7 @@ foreach my $op (qw(<=> == != < <= > >=)) {
}
{
- use Scalar::Util 'weaken';
+ use builtin 'weaken';
package Shklitza;
use overload '""' => sub {"CLiK KLAK"};