summaryrefslogtreecommitdiff
path: root/t/op/substr.t
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-05-07 16:05:16 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-05-07 16:05:16 +0000
commit3aa33fe55ba20233f560f0c549294d8e83806012 (patch)
treec1b0f0f2434610012cab3d272fd45f8006b55411 /t/op/substr.t
parentdfcb284a2bcae98854733134f50bc110c487b8a3 (diff)
downloadperl-3aa33fe55ba20233f560f0c549294d8e83806012.tar.gz
reverse() and quotemeta() weren't preserving utf8-ness; add tests
p4raw-id: //depot/perl@6087
Diffstat (limited to 't/op/substr.t')
-rwxr-xr-xt/op/substr.t15
1 files changed, 10 insertions, 5 deletions
diff --git a/t/op/substr.t b/t/op/substr.t
index a67eae56ac..d3668ac35f 100755
--- a/t/op/substr.t
+++ b/t/op/substr.t
@@ -1,10 +1,12 @@
+#!./perl
-print "1..130\n";
+print "1..132\n";
#P = start of string Q = start of substr R = end of substr S = end of string
BEGIN {
- unshift @INC, '../lib' if -d '../lib' ;
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
}
use warnings ;
@@ -272,12 +274,15 @@ ok 125, $a eq 'xxxxefgh';
# utf8 sanity
{
my $x = substr("a\x{263a}b",0);
- ok 126, length($x) eq 3;
+ ok 126, length($x) == 3;
$x = substr($x,1,1);
ok 127, $x eq "\x{263a}";
$x = $x x 2;
- ok 128, length($x) eq 2;
+ ok 128, length($x) == 2;
substr($x,0,1) = "abcd";
ok 129, $x eq "abcd\x{263a}";
- ok 130, length($x) eq 5;
+ ok 130, length($x) == 5;
+ $x = reverse $x;
+ ok 131, length($x) == 5;
+ ok 132, $x eq "\x{263a}dcba";
}