summaryrefslogtreecommitdiff
path: root/t/pragma
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-10-15 15:19:29 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-10-15 15:19:29 +0000
commit93f04dac2ed878fbeae5ba64df628ed3ab0b6e21 (patch)
tree6a8cdf1a14fe7c3cf774c2445401be66cff399aa /t/pragma
parent2a9c8e45b384ebf49f1c7a8f39efef187bdbfb6f (diff)
downloadperl-93f04dac2ed878fbeae5ba64df628ed3ab0b6e21.tar.gz
split() utf8 fixes. Should fix both 20001014.001 and 20000426.003.
The problem was that rx->minlen was in chars while pp_split() thought it would be in bytes. p4raw-id: //depot/perl@7234
Diffstat (limited to 't/pragma')
-rwxr-xr-xt/pragma/utf8.t36
1 files changed, 35 insertions, 1 deletions
diff --git a/t/pragma/utf8.t b/t/pragma/utf8.t
index 953064c7be..51c084cffa 100755
--- a/t/pragma/utf8.t
+++ b/t/pragma/utf8.t
@@ -10,7 +10,7 @@ BEGIN {
}
}
-print "1..82\n";
+print "1..87\n";
my $test = 1;
@@ -437,3 +437,37 @@ sub nok_bytes {
print "ok $test\n";
$test++;
}
+
+{
+ # bug id 20000426.003
+
+ use utf8;
+
+ my $s = "\x20\x40\x{80}\x{100}\x{80}\x40\x20";
+
+ my ($a, $b, $c) = split(/\x40/, $s);
+ print "not "
+ unless $a eq "\x20" && $b eq "\x{80}\x{100}\x{80}" && $c eq $a;
+ print "ok $test\n";
+ $test++;
+
+ my ($a, $b) = split(/\x{100}/, $s);
+ print "not " unless $a eq "\x20\x40\x{80}" && $b eq "\x{80}\x40\x20";
+ print "ok $test\n";
+ $test++;
+
+ my ($a, $b) = split(/\x{80}\x{100}\x{80}/, $s);
+ print "not " unless $a eq "\x20\x40" && $b eq "\x40\x20";
+ print "ok $test\n";
+ $test++;
+
+ my ($a, $b) = split(/\x40\x{80}/, $s);
+ print "not " unless $a eq "\x20" && $b eq "\x{100}\x{80}\x40\x20";
+ print "ok $test\n";
+ $test++;
+
+ my ($a, $b, $c) = split(/[\x40\x{80}]+/, $s);
+ print "not " unless $a eq "\x20" && $b eq "\x{100}" && $c eq "\x20";
+ print "ok $test\n";
+ $test++;
+}