From a983b08dc7c658d412bac21b8ceac00c24ae5c11 Mon Sep 17 00:00:00 2001 From: "H.Merijn Brand" Date: Wed, 1 Nov 2006 18:03:55 +0100 Subject: [PATCH] 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" Message-ID: <20061101170355.7c57b515@pc09> p4raw-id: //depot/perl@29182 --- t/lib/common.pl | 8 +++++++- t/lib/warnings/9uninit | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/t/lib/common.pl b/t/lib/common.pl index 99c6e9d..6dad282 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 82fc387..9b60808 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); -- 2.7.4