summaryrefslogtreecommitdiff
path: root/t/op/substr.t
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-03-19 23:17:17 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-03-19 23:17:17 +0000
commitf7928d6c98a55cfb1aa37088308b1e8ca18c526b (patch)
tree9729602e8b35f928442501a398cbce5f19bc7183 /t/op/substr.t
parent5fe84fd29acaf55c3d2b93f4d6ba263d0ef2be35 (diff)
downloadperl-f7928d6c98a55cfb1aa37088308b1e8ca18c526b.tar.gz
substr($bytestr, i, n, $charstr)
TODO: we are still broken if $bytestr needs UTF-8 upgrading. p4raw-id: //depot/perl@9255
Diffstat (limited to 't/op/substr.t')
-rwxr-xr-xt/op/substr.t21
1 files changed, 20 insertions, 1 deletions
diff --git a/t/op/substr.t b/t/op/substr.t
index 12bcd00b33..7ac419406b 100755
--- a/t/op/substr.t
+++ b/t/op/substr.t
@@ -1,6 +1,6 @@
#!./perl
-print "1..162\n";
+print "1..168\n";
#P = start of string Q = start of substr R = end of substr S = end of string
@@ -548,3 +548,22 @@ ok 162, length($x) == 5 &&
substr($x, 2, 1) eq "\x{100}" &&
substr($x, 3, 1) eq "\x{FF}" &&
substr($x, 4, 1) eq "\x{F3}";
+
+substr($x = "ab", 0, 0, "\x{100}\x{200}");
+ok 163, $x eq "\x{100}\x{200}ab";
+
+substr($x = "\x{100}\x{200}", 0, 0, "ab");
+ok 164, $x eq "ab\x{100}\x{200}";
+
+substr($x = "ab", 1, 0, "\x{100}\x{200}");
+ok 165, $x eq "a\x{100}\x{200}b";
+
+substr($x = "\x{100}\x{200}", 1, 0, "ab");
+ok 166, $x eq "\x{100}ab\x{200}";
+
+substr($x = "ab", 2, 0, "\x{100}\x{200}");
+ok 167, $x eq "ab\x{100}\x{200}";
+
+substr($x = "\x{100}\x{200}", 2, 0, "ab");
+ok 168, $x eq "\x{100}\x{200}ab";
+