import Encode qw(:fallback_all);
}
-use Test::More tests => 9;
+use Test::More tests => 10;
# $PerlIO::encoding = 0; # WARN_ON_ERR|PERLQQ;
is($line,"\\xA30.02\n","Escaped non-mapped char");
close($fh);
-$PerlIO::encoding::fallback = Encode::WARN_ON_ERR;
+{
+ my $message = '';
+ local $SIG{__WARN__} = sub { $message = $_[0] };
-ok(open($fh,"<encoding(US-ASCII)",$file),"Opened as ASCII");
-my $line = <$fh>;
-printf "# %x\n",ord($line);
-is($line,"\x{FFFD}0.02\n","Unicode replacement char");
-close($fh);
+ $PerlIO::encoding::fallback = Encode::WARN_ON_ERR;
+
+ ok(open($fh,"<encoding(US-ASCII)",$file),"Opened as ASCII");
+ my $line = <$fh>;
+ printf "# %x\n",ord($line);
+ is($line,"\x{FFFD}0.02\n","Unicode replacement char");
+ close($fh);
+
+ like($message, qr/does not map to Unicode/o, "FB_WARN message");
+}
END {
1 while unlink($file);