summaryrefslogtreecommitdiff
path: root/t/op/substr.t
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2005-04-21 15:36:14 +0000
committerDave Mitchell <davem@fdisolutions.com>2005-04-21 15:36:14 +0000
commitec0624293b57ae07d6b2c32bae099d4f163e7e07 (patch)
tree01d6b0ff58f43fa9a8d6808c0773376527f812a6 /t/op/substr.t
parenta9c4fd4eb137d3951b59e73b4474669240f974c1 (diff)
downloadperl-ec0624293b57ae07d6b2c32bae099d4f163e7e07.tar.gz
[perl #34976] substr uses utf8 length cache incorrectly
p4raw-id: //depot/perl@24270
Diffstat (limited to 't/op/substr.t')
-rwxr-xr-xt/op/substr.t9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/op/substr.t b/t/op/substr.t
index 9549d29028..2c6a0ed32e 100755
--- a/t/op/substr.t
+++ b/t/op/substr.t
@@ -1,6 +1,6 @@
#!./perl
-print "1..190\n";
+print "1..192\n";
#P = start of string Q = start of substr R = end of substr S = end of string
@@ -658,3 +658,10 @@ ok 174, $x eq "\x{100}\x{200}\xFFb";
substr($a, -1) &= chr(0xfeff);
ok 190, $a eq "\xbf";
}
+
+# [perl #34976] incorrect caching of utf8 substr length
+{
+ my $a = "abcd\x{100}";
+ ok 191, substr($a,1,2) eq 'bc';
+ ok 192, substr($a,1,1) eq 'b';
+}