diff options
author | Brian Fraser <fraserbn@gmail.com> | 2011-09-27 20:33:02 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-10-06 13:01:11 -0700 |
commit | 1fddc1283eec7855a9c74204f8f4db3b35be302a (patch) | |
tree | e32b6cc544b4f48534e66de23ade11c50829921c /t | |
parent | aa33328e822d3a36d7448488403f30a991f148b2 (diff) | |
download | perl-1fddc1283eec7855a9c74204f8f4db3b35be302a.tar.gz |
doio.c: Make warnings UTF8- and nul-clean
Diffstat (limited to 't')
-rw-r--r-- | t/lib/warnings/doio | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/t/lib/warnings/doio b/t/lib/warnings/doio index 8f6e558b52..0e1b08fcc2 100644 --- a/t/lib/warnings/doio +++ b/t/lib/warnings/doio @@ -164,6 +164,20 @@ no warnings 'io'; EXPECT Use of -l on filehandle STDIN at - line 3. ######## +# doio.c [Perl_my_stat] +# TODO ? 1 ? "Scalar filehandles aren't yet clean" : '' +use utf8; +use open qw( :utf8 :std ); +use warnings 'io'; +-l $ᶠᚻ; +open $ᶠᚻ, $0 or die "# $!"; +-l $ᶠᚻ; +no warnings 'io'; +-l $ᶠᚻ; +close $ᶠᚻ; +EXPECT +Use of -l on filehandle $ᶠᚻ at - line 7. +######## # doio.c [Perl_do_aexec5] use warnings 'io' ; exec "lskdjfalksdjfdjfkls","" ; @@ -264,6 +278,27 @@ Filehandle STDOUT reopened as FH1 only for input at - line 14. ######## # doio.c [Perl_do_openn] use Config; +use utf8; +use open qw( :utf8 :std ); +BEGIN { + if (!$Config{useperlio}) { + print <<EOM; +SKIPPED +# warns only with perlio +EOM + exit; + } +} +use warnings 'io' ; +close STDOUT; +open ᶠᚻ1, "../harness"; close ᶠᚻ1; +no warnings 'io' ; +open ᶠᚻ2, "../harness"; close ᶠᚻ2; +EXPECT +Filehandle STDOUT reopened as ᶠᚻ1 only for input at - line 16. +######## +# doio.c [Perl_do_openn] +use Config; BEGIN { if (!$Config{useperlio}) { print <<EOM; @@ -281,3 +316,48 @@ open my $fh2, ">doiowarn.tmp"; close $fh2; unlink "doiowarn.tmp"; EXPECT Filehandle STDIN reopened as $fh1 only for output at - line 14. +######## +# doio.c [Perl_do_openn] +# TODO ? 1 ? "Scalar filehandles aren't yet clean" : '' +use Config; +use utf8; +use open qw( :utf8 :std ); +BEGIN { + if (!$Config{useperlio}) { + print <<EOM; +SKIPPED +# warns only with perlio +EOM + exit; + } +} +use warnings 'io' ; +close STDIN; +open my $ᶠᚻ1, ">doiowarn.tmp"; close $ᶠᚻ1; +no warnings 'io' ; +open my $ᶠᚻ2, ">doiowarn.tmp"; close $ᶠᚻ2; +unlink "doiowarn.tmp"; +EXPECT +Filehandle STDIN reopened as $ᶠᚻ1 only for output at - line 16. +######## +# doio.c [Perl_do_openn] +use Config; +use utf8; +use open qw( :utf8 :std ); +BEGIN { + if (!$Config{useperlio}) { + print <<EOM; +SKIPPED +# warns only with perlio +EOM + exit; + } +} +use warnings 'io' ; +close STDIN; +open ᶠᚻ1, ">doiowarn.tmp"; close ᶠᚻ1; +no warnings 'io' ; +open ᶠᚻ2, ">doiowarn.tmp"; close ᶠᚻ2; +unlink "doiowarn.tmp"; +EXPECT +Filehandle STDIN reopened as ᶠᚻ1 only for output at - line 16. |