From d1e4d418969ad3c5103f26f33d0abea5b1570935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=B6nig?= Date: Sat, 29 Dec 2001 22:42:37 +0100 Subject: cleaner close on tests, take 2 Message-ID: (except for the three DB_File patch fragments) p4raw-id: //depot/perl@13940 --- t/comp/cpp.aux | 4 ++-- t/comp/multiline.t | 2 +- t/comp/require.t | 2 +- t/comp/script.t | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 't/comp') diff --git a/t/comp/cpp.aux b/t/comp/cpp.aux index 058903294e..9452bddbbe 100755 --- a/t/comp/cpp.aux +++ b/t/comp/cpp.aux @@ -25,11 +25,11 @@ X#endif Xprint $ok; END print TRY $prog; -close TRY; +close TRY or die "Could not close Comp_cpp.tmp: $!"; open(TRY,">Comp_cpp.inc") || (die "Can't open temp include file: $!"); print TRY '#define OK "ok 3\n"' . "\n"; -close TRY; +close TRY or die "Could not close Comp_cpp.tmp: $!"; print `$^X "-P" Comp_cpp.tmp`; unlink "Comp_cpp.tmp", "Comp_cpp.inc"; diff --git a/t/comp/multiline.t b/t/comp/multiline.t index 742ba4965d..78820c4e92 100755 --- a/t/comp/multiline.t +++ b/t/comp/multiline.t @@ -26,7 +26,7 @@ $y = 'now is the time' . "\n" . is($x, $y, 'test data is sane'); print TRY $x; -close TRY; +close TRY or die "Could not close: $!"; open(TRY,'Comp.try') || (die "Can't reopen temp file."); $count = 0; diff --git a/t/comp/require.t b/t/comp/require.t index 103a579235..ea4b96d20b 100755 --- a/t/comp/require.t +++ b/t/comp/require.t @@ -27,7 +27,7 @@ sub write_file { binmode REQ; use bytes; print REQ @_; - close REQ; + close REQ or die "Could not close $f: $!"; } eval {require 5.005}; diff --git a/t/comp/script.t b/t/comp/script.t index d70b767478..2dbdaf2afc 100755 --- a/t/comp/script.t +++ b/t/comp/script.t @@ -16,7 +16,7 @@ if ($x eq "ok\n") {print "ok 1\n";} else {print "not ok 1\n";} open(try,">Comp.script") || (die "Can't open temp file."); print try 'print "ok\n";'; print try "\n"; -close try; +close try or die "Could not close: $!"; $x = `$Perl Comp.script`; -- cgit v1.2.1