summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Kogai <dankogai@dan.co.jp>2002-05-02 09:14:41 +0900
committerJarkko Hietaniemi <jhi@iki.fi>2002-05-01 15:29:44 +0000
commit709a84d396fb61095efc6271945c1c69bdb4ecfd (patch)
tree3ba5d337e5c273cda9955ca20d625edf27480ae6
parent830498575a8e7c3f9fe8227903ce62de6b54b41c (diff)
downloadperl-709a84d396fb61095efc6271945c1c69bdb4ecfd.tar.gz
[Patch] ext/PerlIO/t/fallback.t gets haircut
Message-Id: <2958D841-5D16-11D6-8A58-00039301D480@dan.co.jp> p4raw-id: //depot/perl@16309
-rw-r--r--ext/PerlIO/t/fallback.t18
1 files changed, 11 insertions, 7 deletions
diff --git a/ext/PerlIO/t/fallback.t b/ext/PerlIO/t/fallback.t
index a15ff719ae..b5eb18d451 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>;