X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fio%2Flayers.t;h=abbc7ecf425e40c970081a3ade5c47773154e6df;hb=ac27d13b824657b726428f3a6a1d5b3a01df569e;hp=41c44c478acfc9adac88389586511a77de2deb09;hpb=9cfa90c07dda2bbf7df20096eab1b9057035d586;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/io/layers.t b/t/io/layers.t index 41c44c4..abbc7ec 100644 --- a/t/io/layers.t +++ b/t/io/layers.t @@ -31,18 +31,20 @@ my $DOSISH = $^O =~ /^(?:MSWin32|os2|dos|NetWare|mint)$/ ? 1 : 0; $DOSISH = 1 if !$DOSISH and $^O =~ /^uwin/; my $NONSTDIO = exists $ENV{PERLIO} && $ENV{PERLIO} ne 'stdio' ? 1 : 0; my $FASTSTDIO = $Config{d_faststdio} && $Config{usefaststdio} ? 1 : 0; -my $UNICODE_STDIN; +my $UTF8_STDIN; if (${^UNICODE} & 1) { if (${^UNICODE} & 64) { # Conditional on the locale - $UNICODE_STDIN = ${^UTF8LOCALE}; + $UTF8_STDIN = ${^UTF8LOCALE}; } else { # Unconditional - $UNICODE_STDIN = 1; + $UTF8_STDIN = 1; } +} else { + $UTF8_STDIN = 0; } my $NTEST = 44 - (($DOSISH || !$FASTSTDIO) ? 7 : 0) - ($DOSISH ? 5 : 0) - + $UNICODE_STDIN; + + $UTF8_STDIN; sub PerlIO::F_UTF8 () { 0x00008000 } # from perliol.h @@ -55,7 +57,7 @@ print <<__EOH__; # FASTSTDIO = $FASTSTDIO # UNICODE = ${^UNICODE} # UTF8LOCALE = ${^UTF8LOCALE} -# UNICODE_STDIN = $UNICODE_STDIN +# UTF8_STDIN = $UTF8_STDIN __EOH__ SKIP: { @@ -120,7 +122,7 @@ SKIP: { } check([ PerlIO::get_layers(STDIN) ], - $UNICODE_STDIN ? [ "stdio", "utf8" ] : [ "stdio" ], + $UTF8_STDIN ? [ "stdio", "utf8" ] : [ "stdio" ], "STDIN"); open(F, ">:crlf", "afile"); @@ -129,11 +131,11 @@ SKIP: { [ qw(stdio crlf) ], "open :crlf"); - binmode(F, ":encoding(sjis)"); # "sjis" will be canonized to "shiftjis" + binmode(F, ":encoding(cp1047)"); check([ PerlIO::get_layers(F) ], - [ qw[stdio crlf encoding(shiftjis) utf8] ], - ":encoding(sjis)"); + [ qw[stdio crlf encoding(cp1047) utf8] ], + ":encoding(cp1047)"); binmode(F, ":pop"); @@ -215,7 +217,7 @@ SKIP: { # Check that PL_sigwarn's reference count is correct, and that # &PerlIO::Layer::NoWarnings isn't prematurely freed. fresh_perl_like (<<'EOT', qr/^CODE/); -open(UTF, "<:raw:encoding(utf8)", $^X) or die $!; +open(UTF, "<:raw:encoding(utf8)", "afile") or die $!; print ref *PerlIO::Layer::NoWarnings{CODE}; EOT