From: Dan Kogai Date: Thu, 2 May 2002 00:14:41 +0000 (+0900) Subject: [Patch] ext/PerlIO/t/fallback.t gets haircut X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=709a84d396fb61095efc6271945c1c69bdb4ecfd;p=p5sagit%2Fp5-mst-13.2.git [Patch] ext/PerlIO/t/fallback.t gets haircut Message-Id: <2958D841-5D16-11D6-8A58-00039301D480@dan.co.jp> p4raw-id: //depot/perl@16309 --- diff --git a/ext/PerlIO/t/fallback.t b/ext/PerlIO/t/fallback.t index a15ff71..b5eb18d 100644 --- a/ext/PerlIO/t/fallback.t +++ b/ext/PerlIO/t/fallback.t @@ -5,7 +5,7 @@ BEGIN { @INC = '../lib'; require "../t/test.pl"; skip_all("No perlio") unless (find PerlIO::Layer 'perlio'); - plan (8); + plan (9); } use Encode qw(:fallback_all); @@ -13,12 +13,16 @@ use Encode qw(:fallback_all); my $file = "fallback$$.txt"; -$PerlIO::encoding::fallback = Encode::PERLQQ; - -ok(open(my $fh,">encoding(iso-8859-1)",$file),"opened iso-8859-1 file"); -my $str = "\x{20AC}"; -print $fh $str,"0.02\n"; -close($fh); +{ + my $message = ''; + local $SIG{__WARN__} = sub { $message = $_[0] }; + $PerlIO::encoding::fallback = Encode::PERLQQ; + ok(open(my $fh,">encoding(iso-8859-1)",$file),"opened iso-8859-1 file"); + my $str = "\x{20AC}"; + print $fh $str,"0.02\n"; + close($fh); + like($message, qr/does not map to iso-8859-1/o, "FB_WARN message"); +} open($fh,$file) || die "File cannot be re-opened"; my $line = <$fh>;