diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-08-06 01:33:55 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-08-06 01:33:55 +0000 |
commit | 2dd78f96d61cc6382dc72214930c993567209597 (patch) | |
tree | 86ec042cca52df9fdf32e1d4aaf99c1e57077661 /t | |
parent | c9166e37736ce050b2ee05d4fdf16697211280ca (diff) | |
download | perl-2dd78f96d61cc6382dc72214930c993567209597.tar.gz |
Continue fixing the io warnings. This also
sort of fixes bug ID 20000802.003: the core dump
is no more. Whether the current behaviour is correct
(giving a warning: "Not a format reference"), is another matter.
p4raw-id: //depot/perl@6531
Diffstat (limited to 't')
-rw-r--r-- | t/pragma/warn/doio | 35 | ||||
-rw-r--r-- | t/pragma/warn/pp_hot | 4 | ||||
-rw-r--r-- | t/pragma/warn/pp_sys | 24 |
3 files changed, 42 insertions, 21 deletions
diff --git a/t/pragma/warn/doio b/t/pragma/warn/doio index 00371031a4..2a357e2755 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 filehandle %s [Perl_do_close] <<TODO + close() on unopened filehandle %s [Perl_do_close] $a = "fred";close("$a") - tell() on unopened filehandle [Perl_do_tell] + tell() on closed filehandle [Perl_do_tell] $a = "fred";$a = tell($a) - seek() on unopened filehandle [Perl_do_seek] + seek() on closed filehandle [Perl_do_seek] $a = "fred";$a = seek($a,1,1) - sysseek() on unopened filehandle [Perl_do_sysseek] + sysseek() on closed filehandle [Perl_do_sysseek] $a = "fred";$a = seek($a,1,1) warn(warn_uninit); [Perl_do_print] print $a ; - -x on unopened filehandle %s [Perl_my_stat] + -x on closed filehandle %s [Perl_my_stat] close STDIN ; -x STDIN ; warn(warn_nl, "stat"); [Perl_my_stat] @@ -106,6 +106,12 @@ $a = seek(STDIN,1,1); $a = sysseek(STDIN,1,1); -x STDIN ; stat(STDIN) ; +$a = "fred"; +tell($a); +seek($a,1,1); +sysseek($a,1,1); +-x $a; # ok +stat($a); # ok no warnings 'io' ; close STDIN ; tell(STDIN); @@ -113,12 +119,21 @@ $a = seek(STDIN,1,1); $a = sysseek(STDIN,1,1); -x STDIN ; stat(STDIN) ; +$a = "fred"; +tell($a); +seek($a,1,1); +sysseek($a,1,1); +-x $a; +stat($a); EXPECT -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. +tell() on closed filehandle STDIN at - line 4. +seek() on closed filehandle STDIN at - line 5. +sysseek() on closed filehandle STDIN at - line 6. +-x on closed filehandle STDIN at - line 7. +stat() on closed filehandle STDIN at - line 8. +tell() on unopened filehandle at - line 10. +seek() on unopened filehandle at - line 11. +sysseek() on unopened filehandle at - line 12. ######## # doio.c [Perl_do_print] use warnings 'uninitialized' ; diff --git a/t/pragma/warn/pp_hot b/t/pragma/warn/pp_hot index fe874ef7ef..3c3cc6021f 100644 --- a/t/pragma/warn/pp_hot +++ b/t/pragma/warn/pp_hot @@ -1,6 +1,6 @@ pp_hot.c - Filehandle %s never opened [pp_print] + print() on unopened filehandle abc [pp_print] $f = $a = "abc" ; print $f $a Filehandle %s opened only for input [pp_print] @@ -52,7 +52,7 @@ print $f $a; no warnings 'unopened' ; print $f $a; EXPECT -Filehandle abc never opened at - line 4. +print() on unopened filehandle abc at - line 4. ######## # pp_hot.c [pp_print] use warnings 'io' ; diff --git a/t/pragma/warn/pp_sys b/t/pragma/warn/pp_sys index feef456c7a..413a17be26 100644 --- a/t/pragma/warn/pp_sys +++ b/t/pragma/warn/pp_sys @@ -16,7 +16,7 @@ page overflow [pp_leavewrite] - Filehandle %s never opened [pp_prtf] + printf() on unopened filehandle abc [pp_prtf] $a = "abc"; printf $a "fred" Filehandle %s opened only for input [pp_prtf] @@ -79,9 +79,9 @@ warn(warn_nl, "stat"); [pp_stat] - -T on unopened filehandle %s - stat() on unopened filehandle %s - close STDIN ; -T STDIN ; + -T on closed filehandle %s + stat() on closed filehandle %s + close STDIN ; -T STDIN ; stat(STDIN) ; warn(warn_nl, "open"); [pp_fttext] -T "abc\ndef" ; @@ -158,7 +158,7 @@ printf $a "fred"; no warnings 'unopened' ; printf $a "fred"; EXPECT -Filehandle abc never opened at - line 4. +printf() on unopened filehandle abc at - line 4. ######## # pp_sys.c [pp_prtf] use warnings 'closed' ; @@ -355,16 +355,22 @@ EXPECT lstat() on filehandle STDIN at - line 13. ######## # pp_sys.c [pp_fttext] -use warnings 'unopened' ; +use warnings qw(unopened closed) ; close STDIN ; -T STDIN ; stat(STDIN) ; -no warnings 'unopened' ; +-T HOCUS; +stat(POCUS); +no warnings qw(unopened closed) ; -T STDIN ; stat(STDIN); +-T HOCUS; +stat(POCUS); EXPECT --T on unopened filehandle STDIN at - line 4. -stat() on unopened filehandle STDIN at - line 5. +-T on closed filehandle STDIN at - line 4. +stat() on closed filehandle STDIN at - line 5. +-T on unopened filehandle HOCUS at - line 6. +stat() on unopened filehandle POCUS at - line 7. ######## # pp_sys.c [pp_fttext] use warnings 'newline' ; |