X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fop%2Ftr.t;h=3a4f610c02dc893b6f018f9608232bfdd930e2bb;hb=e24631be6ac297b562086a055de17c5bd4247797;hp=2f4e7de67e7bfdfad8710d5524acb7ad311bb777;hpb=953ab6e5d4c89e9e1eb3c919a578ff14c2d6a823;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/op/tr.t b/t/op/tr.t index 2f4e7de..3a4f610 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); @@ -33,7 +33,7 @@ is($_, "aBCDEFGHIJKLMNOPQRSTUVWXYz", 'partial uc'); tr/I-J/i-j/; - is($_, "i\xcaj", 'lc with unicode'); + is($_, "i\xcaj", 'EBCDIC discontinuity'); } # @@ -160,7 +160,7 @@ is($_, '...d.f...j.l...p'); # 20000705 MJD eval "tr/m-d/ /"; -like($@, qr/^Invalid \[\] range "m-d" in transliteration operator/, +like($@, qr/^Invalid range "m-d" in transliteration operator/, 'reversed range check'); eval '$1 =~ tr/x/y/'; @@ -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" );