summaryrefslogtreecommitdiff
path: root/t/pragma
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-12-29 07:57:52 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-12-29 07:57:52 +0000
commit5fdef8e23073a2e8237aa0d8af54b268cb010316 (patch)
treeb47a1a90e76fdf1aa80b32f49229ff64aa691529 /t/pragma
parent7df053ec69e901392ae6352566832be0a6917cfe (diff)
downloadperl-5fdef8e23073a2e8237aa0d8af54b268cb010316.tar.gz
More split // UTF-8 tests.
p4raw-id: //depot/perl@8250
Diffstat (limited to 't/pragma')
-rwxr-xr-xt/pragma/utf8.t47
1 files changed, 46 insertions, 1 deletions
diff --git a/t/pragma/utf8.t b/t/pragma/utf8.t
index 8e4d296f5d..e55637edaa 100755
--- a/t/pragma/utf8.t
+++ b/t/pragma/utf8.t
@@ -10,7 +10,7 @@ BEGIN {
}
}
-print "1..105\n";
+print "1..109\n";
my $test = 1;
@@ -554,3 +554,48 @@ sub nok_bytes {
print "ok $test\n";
$test++; # 105
}
+
+{
+ use utf8;
+ my @a = map ord, split(/\x{123}/,
+ join("", map chr, (1234, 0x123,
+ 0x123,
+ 23, 0x123,
+ 123, 0x123,
+ 128, 0x123,
+ 255, 0x123,
+ 2345)));
+ ok "@a", "1234 0 23 123 128 255 2345";
+ $test++; # 106
+}
+
+{
+ use utf8;
+ my @a = map ord, split(/(\x{123})/,
+ join("", map chr, (1234, 0x123,
+ 0x123,
+ 23, 0x123,
+ 123, 0x123,
+ 128, 0x123,
+ 255, 0x123,
+ 2345)));
+ # 291 is 0x123
+ ok "@a", "1234 291 0 291 23 291 123 291 128 291 255 291 2345";
+ $test++; # 107 (variant of test 106)
+}
+
+{
+ use utf8;
+ my @a = map ord, split(//, join("", map chr, (1234, 0xff, 2345)));
+ ok "@a", "1234 255 2345";
+ $test++; # 108 (variant of test 66)
+}
+
+{
+ use utf8;
+ my $x = chr(0xff);
+ my @a = map ord, split(/$x/, join("", map chr, (1234, 0xff, 2345)));
+ ok "@a", "1234 2345";
+ $test++; # 109 (variant of test 67)
+}
+