From: Rafael Garcia-Suarez Date: Mon, 12 Feb 2007 17:00:09 +0000 (+0000) Subject: Skip this test if "use open" fails due to an unknown encoding X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=771ed9f1af61a5ebf694942246ba6240a0a817ce;p=p5sagit%2Fp5-mst-13.2.git Skip this test if "use open" fails due to an unknown encoding p4raw-id: //depot/perl@30233 --- diff --git a/ext/PerlIO/encoding/t/nolooping.t b/ext/PerlIO/encoding/t/nolooping.t index c86cd0f..f3436ad 100644 --- a/ext/PerlIO/encoding/t/nolooping.t +++ b/ext/PerlIO/encoding/t/nolooping.t @@ -2,9 +2,15 @@ use Test::More tests => 1; +BEGIN { + $SIG{__WARN__} = sub { $warn .= $_[0] }; +} + # bug #41442 use PerlIO::encoding; use open ':locale'; -if (-e '/dev/null') { open STDERR, '>', '/dev/null' } -warn "# \x{201e}\n"; # „ +if ($warn !~ /Cannot find encoding/) { + if (-e '/dev/null') { open STDERR, '>', '/dev/null' } + warn "# \x{201e}\n"; # „ +} ok(1); # we got that far