summaryrefslogtreecommitdiff
path: root/t/lib
diff options
context:
space:
mode:
authorH.Merijn Brand <h.m.brand@xs4all.nl>2006-11-01 18:03:55 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-11-01 16:29:05 +0000
commita983b08dc7c658d412bac21b8ceac00c24ae5c11 (patch)
treeca956d6d5fc04c4622a78ab7dd7c42f87c830a4f /t/lib
parent64764f67955c7f025bf507967209b617305e1e04 (diff)
downloadperl-a983b08dc7c658d412bac21b8ceac00c24ae5c11.tar.gz
Fix the failures in warnings tests when PERL_UNICODE is defined
that show up in the smokes under UTF-8 locales. Based on : Subject: Re: UTF-8 Failures in smoke ($PERL_UNICODE) From: "H.Merijn Brand" <h.m.brand@xs4all.nl> Message-ID: <20061101170355.7c57b515@pc09> p4raw-id: //depot/perl@29182
Diffstat (limited to 't/lib')
-rw-r--r--t/lib/common.pl8
-rw-r--r--t/lib/warnings/9uninit4
2 files changed, 9 insertions, 3 deletions
diff --git a/t/lib/common.pl b/t/lib/common.pl
index 99c6e9da5f..6dad282a61 100644
--- a/t/lib/common.pl
+++ b/t/lib/common.pl
@@ -58,7 +58,7 @@ undef $/;
plan tests => (scalar(@prgs)-$files);
-
+my $utf8_ok = exists $ENV{PERL_UNICODE} && $ENV{PERL_UNICODE} =~ m{^$|[Dio]} ? 1 : 0;
for (@prgs){
unless (/\n/)
@@ -73,6 +73,12 @@ for (@prgs){
$switch = $&;
}
my($prog,$expected) = split(/\nEXPECT(?:\n|$)/, $_, 2);
+ $expected =~ s{\b
+ UTF8 \s*
+ \? \s* '(.*?)'
+ : \s* '(.*?)'
+ }{$utf8_ok?$1:$2}gexs;
+
my ($todo, $todo_reason);
$todo = $prog =~ s/^#\s*TODO(.*)\n//m and $todo_reason = $1;
if ( $prog =~ /--FILE--/) {
diff --git a/t/lib/warnings/9uninit b/t/lib/warnings/9uninit
index 82fc3873ba..9b60808d0d 100644
--- a/t/lib/warnings/9uninit
+++ b/t/lib/warnings/9uninit
@@ -1290,10 +1290,10 @@ $v = eval $m1;
EXPECT
Use of uninitialized value $_ in eval "string" at - line 4.
Use of uninitialized value $_ in eval "string" at - line 4.
-Use of uninitialized value $_ in eval "string" at - line 4.
-Use of uninitialized value $m1 in eval "string" at - line 5.
+Use of uninitialized value UTF8?'':'$_ 'in eval "string" at - line 4.
Use of uninitialized value $m1 in eval "string" at - line 5.
Use of uninitialized value $m1 in eval "string" at - line 5.
+Use of uninitialized value UTF8?'':'$m1 'in eval "string" at - line 5.
########
use warnings 'uninitialized';
my ($m1);