From: Gurusamy Sarathy Date: Mon, 22 Apr 2002 08:37:17 +0000 (+0000) Subject: clean up after stray test file littering X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0ec158f4b0db050abb15876df15f5f883540cfd9;p=p5sagit%2Fp5-mst-13.2.git clean up after stray test file littering NOTE: PerlIO/t/via.t leaves behind a via$$ file on windows when it seems that it shouldn't (looks like a handle leak in PerlIO to me) p4raw-id: //depot/perl@16065 --- diff --git a/lib/FileCache.t b/lib/FileCache.t index 87bfd95..1d91d21 100755 --- a/lib/FileCache.t +++ b/lib/FileCache.t @@ -24,11 +24,11 @@ my @files = qw(foo bar baz quux); my @cat; for my $path ( @files ){ print $path "$path 2\n"; - close($path); + close($path); open($path, $path); <$path>; push @cat, <$path>; - close($path); + close($path); } print "not " if (grep {/foo|bar/} @cat) && ! (grep {/baz|quux/} @cat); print "ok 2\n" ; @@ -57,6 +57,7 @@ my @files = qw(foo bar baz quux); cacheout '<', "foo"; print "not " unless eq "foo 2\n"; print "ok 4\n"; + close(foo); } {# Test 5: that close is overridden properly @@ -68,6 +69,7 @@ my @files = qw(foo bar baz quux); seek($_, 0, 0); print "not " unless <$_> eq "$_\n"; print "ok 5\n"; + close($_); } q( @@ -82,6 +84,7 @@ q( seek($_, 0, 0); print "not " unless <$_> eq "$_\n"; print "ok 5\n"; + close($_); } ); diff --git a/lib/Pod/t/eol.t b/lib/Pod/t/eol.t index ea2c259..331d27f 100644 --- a/lib/Pod/t/eol.t +++ b/lib/Pod/t/eol.t @@ -94,7 +94,9 @@ my $cksum3 = unpack("%32C*", ); ok($cksum1 == $cksum2, "CR vs LF"); ok($cksum1 == $cksum3, "CR vs CRLF"); ok($cksum2 == $cksum3, "LF vs CRLF"); +close IN; END { - 1 while unlink("$$.pod", "$$.in", "$$.o1", "$$.o2", "$$.o3"); + 1 while unlink("$$.pod", "$$.in", "$$.o1", "$$.o2", "$$.o3", + "pod2htmd.x~~", "pod2htmi.x~~"); } diff --git a/lib/Tie/File/t/31_autodefer.t b/lib/Tie/File/t/31_autodefer.t index 53371c0..ea929a4 100644 --- a/lib/Tie/File/t/31_autodefer.t +++ b/lib/Tie/File/t/31_autodefer.t @@ -175,6 +175,8 @@ sub ctrlfix { } END { + undef $o; + untie @a; 1 while unlink $file; } diff --git a/lib/Tie/File/t/32_defer_misc.t b/lib/Tie/File/t/32_defer_misc.t index 5193cf0..e0e3f15 100644 --- a/lib/Tie/File/t/32_defer_misc.t +++ b/lib/Tie/File/t/32_defer_misc.t @@ -225,6 +225,8 @@ sub ctrlfix { } END { + undef $o; + untie @a; 1 while unlink $file; } diff --git a/lib/Tie/File/t/33_defer_vs.t b/lib/Tie/File/t/33_defer_vs.t index 69f32a6..071af77 100644 --- a/lib/Tie/File/t/33_defer_vs.t +++ b/lib/Tie/File/t/33_defer_vs.t @@ -118,6 +118,8 @@ sub ctrlfix { } END { + undef $o; + untie @a; 1 while unlink $file; } diff --git a/t/lib/warnings/perlio b/t/lib/warnings/perlio index 7be0219..63279ee 100644 --- a/t/lib/warnings/perlio +++ b/t/lib/warnings/perlio @@ -29,6 +29,7 @@ no warnings 'layer'; open(F, ">:-aa", "bb"); use warnings 'layer'; open(F, ">:-aa", "bb"); +close F; EXPECT perlio: invalid separator character '-' in layer specification list -aa at - line 6. ######## @@ -38,6 +39,7 @@ no warnings 'layer'; open(F, ">:aa(", "bb"); use warnings 'layer'; open(F, ">:aa(", "bb"); +close F; EXPECT perlio: argument list not closed for layer "aa(" at - line 6. ######## @@ -50,6 +52,7 @@ no warnings 'layer'; open(F, ">:xyz", "bb"); use warnings 'layer'; open(F, ">:xyz", "bb"); +close F; END { 1 while unlink "bb" } # KEEP THIS WITH THE LAST TEST. EXPECT perlio: unknown layer "xyz". diff --git a/t/win32/system.t b/t/win32/system.t index a0266da..bd65412 100644 --- a/t/win32/system.t +++ b/t/win32/system.t @@ -76,8 +76,7 @@ close $F; # build the executable chdir($testdir); END { -# chdir($cwd); -# rmtree($testdir); + chdir($cwd) && rmtree("$cwd/$testdir") if -d "$cwd/$testdir"; } if (open(my $EIN, "$cwd/op/${exename}_exe.uu")) { print "# Unpacking $exename.exe\n";