X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fpragma%2Fwarn%2Fpp_sys;h=2843c70ed31e2556feed0d9ae120778e5d0436c2;hb=22d4bb9ccb8701e68f9243547d7e3a3c55f70908;hp=ad5982ab8102e7c86234a322e5aa7e7c47f979fc;hpb=4b19af017623bfa3bb72bb164598a517f586e0d3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/pragma/warn/pp_sys b/t/pragma/warn/pp_sys index ad5982a..2843c70 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] @@ -69,13 +69,19 @@ getpeername STDIN; flock() on closed socket %s [pp_flock] + flock() on closed socket [pp_flock] close STDIN; flock STDIN, 8; + flock $a, 8; + + lstat() on filehandle %s [pp_stat] + lstat(STDIN); warn(warn_nl, "stat"); [pp_stat] - Test on unopened file <%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" ; @@ -152,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' ; @@ -205,19 +211,25 @@ EOM exit ; } } -use warnings 'closed' ; +use warnings qw(unopened closed); close STDIN; flock STDIN, 8; opendir STDIN, "."; flock STDIN, 8; -no warnings 'closed' ; +flock FOO, 8; +flock $a, 8; +no warnings qw(unopened closed); flock STDIN, 8; opendir STDIN, "."; flock STDIN, 8; +flock FOO, 8; +flock $a, 8; EXPECT flock() on closed filehandle STDIN at - line 14. flock() on closed filehandle STDIN at - line 16. (Are you trying to call flock() on dirhandle STDIN?) +flock() on unopened filehandle FOO at - line 17. +flock() on unopened filehandle at - line 18. ######## # pp_sys.c [pp_prtf pp_send pp_bind pp_connect pp_listen pp_accept pp_shutdown pp_ssockopt ppp_getpeername] use warnings 'io' ; @@ -324,14 +336,41 @@ stat "abc\ndef"; EXPECT Unsuccessful stat on filename containing newline at - line 3. ######## +# pp_sys.c [pp_stat] +use Config; +BEGIN { + if ($^O eq 'd_lstat') { + print <$file") ; my $a = sysread(F, $a,10) ; @@ -351,4 +397,4 @@ my $a = sysread(F, $a,10) ; close F ; unlink $file ; EXPECT -Filehandle F opened only for output at - line 5. +Filehandle F opened only for output at - line 12.