diff options
author | Jerry D. Hedden <jdhedden@cpan.org> | 2008-09-16 12:35:11 -0400 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-09-16 21:04:14 +0000 |
commit | f89542f789fc8ac88f7cd7e93bb8d9cd6228182b (patch) | |
tree | c00204c6fe3efbdea898f7de830e86f22bfc2ae0 | |
parent | 3affb40daa9f27a344173c8cba505eb967c64b0f (diff) | |
download | perl-f89542f789fc8ac88f7cd7e93bb8d9cd6228182b.tar.gz |
Don't reuse temp files in tests
From: "Jerry D. Hedden" <jdhedden@cpan.org>
Message-ID: <1ff86f510809161335j73312da3v90fa6ef0cb8ac7c@mail.gmail.com>
Date: Tue, 16 Sep 2008 16:35:11 -0400
p4raw-id: //depot/perl@34377
-rw-r--r-- | lib/charnames.t | 4 | ||||
-rw-r--r-- | lib/strict.t | 3 | ||||
-rw-r--r-- | lib/subs.t | 3 |
3 files changed, 3 insertions, 7 deletions
diff --git a/lib/charnames.t b/lib/charnames.t index 4889562455..5a6671ba7b 100644 --- a/lib/charnames.t +++ b/lib/charnames.t @@ -271,10 +271,8 @@ print "ok 46\n"; # ---- Alias extensions -my $tmpfile = tempfile(); my $alifile = File::Spec->catfile(File::Spec->updir, qw(lib unicore xyzzy_alias.pl)); my $i = 0; -END { if ($tmpfile) { 1 while unlink $tmpfile; } } my @prgs; { local $/ = undef; @@ -285,6 +283,7 @@ my $i = 46; for (@prgs) { my ($code, $exp) = ((split m/\nEXPECT\n/), '$'); my ($prog, $fil) = ((split m/\nFILE\n/, $code), ""); + my $tmpfile = tempfile(); open my $tmp, "> $tmpfile" or die "Could not open $tmpfile: $!"; print $tmp $prog, "\n"; close $tmp or die "Could not close $tmpfile: $!"; @@ -322,7 +321,6 @@ for (@prgs) { print "not "; } print "ok ", ++$i, "\n"; - 1 while unlink $tmpfile; $fil or next; 1 while unlink $alifile; } diff --git a/lib/strict.t b/lib/strict.t index 1176be8083..bfe6b636c5 100644 --- a/lib/strict.t +++ b/lib/strict.t @@ -12,9 +12,7 @@ $| = 1; my $Is_VMS = $^O eq 'VMS'; my $Is_MSWin32 = $^O eq 'MSWin32'; my $Is_NetWare = $^O eq 'NetWare'; -my $tmpfile = tempfile(); my $i = 0 ; -END { if ($tmpfile) { 1 while unlink $tmpfile; } } my @prgs = () ; @@ -65,6 +63,7 @@ for (@prgs){ $prog = shift @files ; $prog =~ s|\./abc|:abc|g if $^O eq 'MacOS'; } + my $tmpfile = tempfile(); open TEST, ">$tmpfile" or die "Could not open: $!"; print TEST $prog,"\n"; close TEST or die "Could not close: $!"; diff --git a/lib/subs.t b/lib/subs.t index 7952c20a6c..b1999b2053 100644 --- a/lib/subs.t +++ b/lib/subs.t @@ -16,9 +16,7 @@ my $Is_VMS = $^O eq 'VMS'; my $Is_MSWin32 = $^O eq 'MSWin32'; my $Is_NetWare = $^O eq 'NetWare'; my $Is_MacOS = $^O eq 'MacOS'; -my $tmpfile = tempfile(); my $i = 0 ; -END { if ($tmpfile) { 1 while unlink $tmpfile} } for (@prgs){ my $switch = ""; @@ -44,6 +42,7 @@ for (@prgs){ shift @files ; $prog = shift @files ; } + my $tmpfile = tempfile(); open TEST, ">$tmpfile"; print TEST $prog,"\n"; close TEST; |