summaryrefslogtreecommitdiff
path: root/t/re
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2014-12-29 13:15:57 -0700
committerKarl Williamson <khw@cpan.org>2014-12-29 13:52:57 -0700
commit613abc6d16e99bd9834fe6afd79beb61a3a4734d (patch)
tree3d2287cfb7ac08c691a642d58b96a2daa76f999d /t/re
parentdbf3c4d788344c8d20eb2549c638ced519d3f0e8 (diff)
downloadperl-613abc6d16e99bd9834fe6afd79beb61a3a4734d.tar.gz
Raise warning on multi-byte char in single-byte locale
See http://nntp.perl.org/group/perl.perl5.porters/211909 Something is quite likely wrong with the logic if say in a Greek locale, Unicode characters (especially Greek ones) are encountered. The same character will be represented by two different code points. This warning alerts the user to this undesirable state of affairs.
Diffstat (limited to 't/re')
-rw-r--r--t/re/charset.t2
-rw-r--r--t/re/pat_advanced.t1
2 files changed, 3 insertions, 0 deletions
diff --git a/t/re/charset.t b/t/re/charset.t
index 4d0d99cfdc..e06191620d 100644
--- a/t/re/charset.t
+++ b/t/re/charset.t
@@ -9,6 +9,8 @@ BEGIN {
use strict;
use warnings;
+no warnings 'locale'; # Some /l tests use above-latin1 chars to make sure
+ # they work, even though they warn.
use Config;
plan('no_plan');
diff --git a/t/re/pat_advanced.t b/t/re/pat_advanced.t
index c210e2e06e..19d6fbce07 100644
--- a/t/re/pat_advanced.t
+++ b/t/re/pat_advanced.t
@@ -866,6 +866,7 @@ sub run_tests {
ok "\x{100}X" =~ /$re/, "S_cl_and ANYOF_UNICODE & ANYOF_INVERTED";
my $loc_re = qq /(?l:^([^X]*)X)/;
utf8::upgrade ($loc_re);
+ no warnings 'locale';
ok "\x{100}X" =~ /$loc_re/, "locale, S_cl_and ANYOF_UNICODE & ANYOF_INVERTED";
}