summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2002-07-01 14:28:04 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2002-07-01 13:40:44 +0000
commitfaf11cac614129491d0258772ee4e6f8a3fb39e8 (patch)
treef22508193de69b5d6e18b2de462abe026471e8c3 /t
parent7f17c5141d7d488a184915d744f3ef35257927e7 (diff)
downloadperl-faf11cac614129491d0258772ee4e6f8a3fb39e8.tar.gz
Re: [ID 20020630.002] utf8 regex only matches 32k
Message-Id: <200207011228.g61CS4T06766@crypt.compulink.co.uk> Date: Mon, 01 Jul 2002 13:28:04 +0100 p4raw-id: //depot/perl@17390
Diffstat (limited to 't')
-rwxr-xr-xt/op/pat.t20
1 files changed, 19 insertions, 1 deletions
diff --git a/t/op/pat.t b/t/op/pat.t
index 5681d6a02b..767c069d2d 100755
--- a/t/op/pat.t
+++ b/t/op/pat.t
@@ -6,7 +6,7 @@
$| = 1;
-print "1..910\n";
+print "1..922\n";
BEGIN {
chdir 't' if -d 't';
@@ -2884,3 +2884,21 @@ EOF
print "d" =~ /\p{InConsonant}/ ? "ok $test\n" : "not ok $test\n"; $test++;
print "e" =~ /\P{InConsonant}/ ? "ok $test\n" : "not ok $test\n"; $test++;
+{
+ print "# [ID 20020630.002] utf8 regex only matches 32k\n";
+ $test = 911;
+ for ([ 'byte', "\x{ff}" ], [ 'utf8', "\x{1ff}" ]) {
+ my($type, $char) = @$_;
+ for my $len (32000, 32768, 33000) {
+ my $s = $char . "f" x $len;
+ my $r = $s =~ /$char([f]*)/gc;
+ print $r ? "ok $test\n" : "not ok $test\t# <$type x $len> fail\n";
+ ++$test;
+ print +(!$r or pos($s) == $len + 1) ? "ok $test\n"
+ : "not ok $test\t# <$type x $len> pos @{[ pos($s) ]}\n";
+ ++$test;
+ }
+ }
+}
+
+$test = 923;