use strict;
BEGIN {
- chdir 't' if -d 't';
- @INC = qw(../lib .);
- require "test.pl";
+ require './test.pl';
+ skip_all("EBCDIC porting needed") if $::IS_EBCDIC;
+ skip_all_without_perlio();
}
-plan tests => 6;
+plan tests => 8;
# Some tests for UTF8 and format/write
$bmulti$blite2
EOEXPECT
-unlink 'Uni_write.tmp';
+{
+ use utf8;
+ use open qw( :utf8 :std );
+
+ local $~ = "놋웇ʱFᚖṀŦ";
+ eval { write };
+ like $@, qr/Undefined format "놋웇ʱFᚖṀŦ/u, 'no such format, with format name in UTF-8.';
+}
+
+{
+
+format OUT =
+
+
+.
+ use utf8;
+ use open qw( :utf8 :std );
+ open OUT, '>', 'Uni_write2.tmp';
+
+ my $oldfh = select OUT;
+ local $^ = "უデfiᕣネḓ_FᚖṀŦɐȾ";#"UNDEFINED_FORMAT";
+ eval { write };
+ like $@, qr/Undefined top format "უデfiᕣネḓ_FᚖṀŦɐȾ/u, 'no such top format';
+ select $oldfh;
+ close OUT;
+}
+
+unlink_all qw( Uni_write.tmp Uni_write2.tmp );