summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2013-10-29 16:08:15 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2013-10-29 16:08:15 +0000
commitd983f14f0774453d4bd79be34c859822e037ed4b (patch)
tree5dd3011251dc6e4bd2e2e42f4aa59baf063c42fb
parent3fa0dc87b388b101f57d89d9df787571669bcd37 (diff)
downloadpcre-d983f14f0774453d4bd79be34c859822e037ed4b.tar.gz
Update perltest.pl to add /u when /W is in the test.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1385 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog5
-rwxr-xr-xperltest.pl21
2 files changed, 14 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 8fed00b..492537b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -142,6 +142,11 @@ Version 8.34 xx-xxxx-201x
29. Whereas an item such as A{4}+ ignored the possessivenes of the quantifier
(because it's meaningless), this was not happening when PCRE_CASELESS was
set. Not wrong, but inefficient.
+
+30. Updated perltest.pl to add /u (force Unicode mode) when /W (use Unicode
+ properties for \w, \d, etc) is present in a test regex. Otherwise if the
+ test contains no characters greater than 255, Perl doesn't realise it
+ should be using Unicode semantics.
Version 8.33 28-May-2013
diff --git a/perltest.pl b/perltest.pl
index 80ab1b8..2c876fc 100755
--- a/perltest.pl
+++ b/perltest.pl
@@ -1,20 +1,17 @@
#! /usr/bin/env perl
# Program for testing regular expressions with perl to check that PCRE handles
-# them the same. This version supports /8 for UTF-8 testing. However, it needs
-# to have "use utf8" at the start for running the UTF-8 tests, but *not* for
-# the other tests. The only way I've found for doing this is to cat this line
-# in explicitly in the RunPerlTest script. I've also used this method to supply
-# "require Encode" for the UTF-8 tests, so that the main test will still run
-# where Encode is not installed.
-
-# use locale; # With this included, \x0b matches \s!
-
-# Function for turning a string into a string of printing chars.
+# them the same. This version needs to have "use utf8" at the start for running
+# the UTF-8 tests, but *not* for the other tests. The only way I've found for
+# doing this is to cat this line in explicitly in the RunPerlTest script. I've
+# also used this method to supply "require Encode" for the UTF-8 tests, so that
+# the main test will still run where Encode is not installed.
#use utf8;
#require Encode;
+# Function for turning a string into a string of printing chars.
+
sub pchars {
my($t) = "";
@@ -106,9 +103,9 @@ for (;;)
$pattern =~ s/K(?=[a-zA-Z]*$)//;
- # Remove /W from a pattern (asks pcretest to set PCRE_UCP)
+ # /W asks pcretest to set PCRE_UCP; change this to /u for Perl
- $pattern =~ s/W(?=[a-zA-Z]*$)//;
+ $pattern =~ s/W(?=[a-zA-Z]*$)/u/;
# Remove /S or /SS from a pattern (asks pcretest to study or not to study)