summaryrefslogtreecommitdiff
path: root/t/op/ref.t
diff options
context:
space:
mode:
Diffstat (limited to 't/op/ref.t')
-rw-r--r--t/op/ref.t11
1 files changed, 10 insertions, 1 deletions
diff --git a/t/op/ref.t b/t/op/ref.t
index 36371f7b73..e2ba10fca2 100644
--- a/t/op/ref.t
+++ b/t/op/ref.t
@@ -8,7 +8,7 @@ BEGIN {
use strict qw(refs subs);
-plan(223);
+plan(224);
# Test glob operations.
@@ -208,6 +208,15 @@ is (ref *STDOUT{IO}, 'IO::File', 'IO refs are blessed into IO::File');
like (*STDOUT{IO}, qr/^IO::File=IO\(0x[0-9a-f]+\)$/,
'stringify for IO refs');
+{ # Test re-use of ref's TARG [perl #101738]
+ my $obj = bless [], '____';
+ my $uniobj = bless [], chr 256;
+ my $get_ref = sub { ref shift };
+ my $dummy = &$get_ref($uniobj);
+ $dummy = &$get_ref($obj);
+ ok exists { ____ => undef }->{$dummy}, 'ref sets UTF8 flag correctly';
+}
+
# Test anonymous hash syntax.
$anonhash = {};