summaryrefslogtreecommitdiff
path: root/t/op/tr.t
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-10-09 19:17:08 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-10-09 19:17:08 +0000
commitd59e14dbffe53a28b0845a7d6b4250babf9e83ac (patch)
treee87993a60fdd580672ebf43813fbdca6dbf79e81 /t/op/tr.t
parentcb23e6a442dc2c0b012e000464ec63c7cf4171fa (diff)
downloadperl-d59e14dbffe53a28b0845a7d6b4250babf9e83ac.tar.gz
Fix bug #17823 : non-modifying tr/// stringifies references
p4raw-id: //depot/perl@17984
Diffstat (limited to 't/op/tr.t')
-rwxr-xr-xt/op/tr.t6
1 files changed, 5 insertions, 1 deletions
diff --git a/t/op/tr.t b/t/op/tr.t
index 69f3796117..3a4f610c02 100755
--- a/t/op/tr.t
+++ b/t/op/tr.t
@@ -6,7 +6,7 @@ BEGIN {
require './test.pl';
}
-plan tests => 97;
+plan tests => 99;
my $Is_EBCDIC = (ord('i') == 0x89 & ord('J') == 0xd1);
@@ -379,3 +379,7 @@ my %foo = ();
eval '$foo{bar} =~ tr/N/N/';
is( $@, '', 'implicit count outside hash bounds' );
is( scalar keys %foo, 0, " doesn't extend the hash");
+
+$x = \"foo";
+is( $x =~ tr/A/A/, 2, 'non-modifying tr/// on a scalar ref' );
+is( ref $x, 'SCALAR', " doesn't stringify its argument" );