Change 16309 by jhi@alpha on 2002/05/01 15:29:44
Subject: [Patch] ext/PerlIO/t/fallback.t gets haircut
From: Dan Kogai <[EMAIL PROTECTED]>
Date: Thu, 2 May 2002 00:14:41 +0900
Message-Id: <[EMAIL PROTECTED]>
Affected files ...
.... //depot/perl/ext/PerlIO/t/fallback.t#3 edit
Differences ...
==== //depot/perl/ext/PerlIO/t/fallback.t#3 (text) ====
Index: perl/ext/PerlIO/t/fallback.t
--- perl/ext/PerlIO/t/fallback.t.~1~ Wed May 1 09:45:06 2002
+++ perl/ext/PerlIO/t/fallback.t Wed May 1 09:45:06 2002
@@ -5,7 +5,7 @@
@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 @@
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>;
End of Patch.