diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-08-04 04:06:30 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-08-04 04:06:30 +0000 |
commit | 9ddeeac95cc2728719c7399fdde362518bb522a0 (patch) | |
tree | d29ddcd441d66850812e030b60e6b2964f47d4c3 /t/pragma | |
parent | 4ec0190b08c455a89a958545841a796e66051771 (diff) | |
download | perl-9ddeeac95cc2728719c7399fdde362518bb522a0.tar.gz |
In the warnings call filehandles consistently so;
add "unopened" warning for stat().
p4raw-id: //depot/perl@6519
Diffstat (limited to 't/pragma')
-rw-r--r-- | t/pragma/warn/doio | 23 | ||||
-rw-r--r-- | t/pragma/warn/pp_sys | 8 |
2 files changed, 19 insertions, 12 deletions
diff --git a/t/pragma/warn/doio b/t/pragma/warn/doio index 813f149fb5..00371031a4 100644 --- a/t/pragma/warn/doio +++ b/t/pragma/warn/doio @@ -12,22 +12,22 @@ warn(warn_nl, "open"); [Perl_do_open9] open(F, "true\ncd") - Close on unopened file %s [Perl_do_close] <<TODO + close() on unopened filehandle %s [Perl_do_close] <<TODO $a = "fred";close("$a") - tell() on unopened file [Perl_do_tell] + tell() on unopened filehandle [Perl_do_tell] $a = "fred";$a = tell($a) - seek() on unopened file [Perl_do_seek] + seek() on unopened filehandle [Perl_do_seek] $a = "fred";$a = seek($a,1,1) - sysseek() on unopened file [Perl_do_sysseek] + sysseek() on unopened filehandle [Perl_do_sysseek] $a = "fred";$a = seek($a,1,1) warn(warn_uninit); [Perl_do_print] print $a ; - Stat on unopened file <%s> [Perl_my_stat] + -x on unopened filehandle %s [Perl_my_stat] close STDIN ; -x STDIN ; warn(warn_nl, "stat"); [Perl_my_stat] @@ -96,7 +96,7 @@ close "fred" ; no warnings 'unopened' ; close "joe" ; EXPECT -Close on unopened file fred at - line 3. +close() on unopened filehandle fred at - line 3. ######## # doio.c [Perl_do_tell Perl_do_seek Perl_do_sysseek Perl_my_stat] use warnings 'io' ; @@ -105,17 +105,20 @@ tell(STDIN); $a = seek(STDIN,1,1); $a = sysseek(STDIN,1,1); -x STDIN ; +stat(STDIN) ; no warnings 'io' ; close STDIN ; tell(STDIN); $a = seek(STDIN,1,1); $a = sysseek(STDIN,1,1); -x STDIN ; +stat(STDIN) ; EXPECT -tell() on unopened file at - line 4. -seek() on unopened file at - line 5. -sysseek() on unopened file at - line 6. -Stat on unopened file STDIN at - line 7. +tell() on unopened filehandle at - line 4. +seek() on unopened filehandle at - line 5. +sysseek() on unopened filehandle at - line 6. +-x on unopened filehandle STDIN at - line 7. +stat() on unopened filehandle STDIN at - line 8. ######## # doio.c [Perl_do_print] use warnings 'uninitialized' ; diff --git a/t/pragma/warn/pp_sys b/t/pragma/warn/pp_sys index ad5982ab81..1666b6a143 100644 --- a/t/pragma/warn/pp_sys +++ b/t/pragma/warn/pp_sys @@ -74,7 +74,8 @@ warn(warn_nl, "stat"); [pp_stat] - Test on unopened file <%s> + -T on unopened filehandle %s + stat() on unopened filehandle %s close STDIN ; -T STDIN ; warn(warn_nl, "open"); [pp_fttext] @@ -328,10 +329,13 @@ Unsuccessful stat on filename containing newline at - line 3. use warnings 'unopened' ; close STDIN ; -T STDIN ; +stat(STDIN) ; no warnings 'unopened' ; -T STDIN ; +stat(STDIN); EXPECT -Test on unopened file STDIN at - line 4. +-T on unopened filehandle STDIN at - line 4. +stat() on unopened filehandle STDIN at - line 5. ######## # pp_sys.c [pp_fttext] use warnings 'newline' ; |