summaryrefslogtreecommitdiff
path: root/lib/AnyDBM_File.t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-01-25 10:27:38 +0000
committerNicholas Clark <nick@ccl4.org>2010-01-25 10:27:38 +0000
commitbdbb64c22f35e0b11cf29ddb2597039baf475c01 (patch)
tree02aada04eee163b211bbd8e3a09d0b51f73a8492 /lib/AnyDBM_File.t
parentdac9950b46a56f9fb4bccdd7fbcbf06e277767a2 (diff)
downloadperl-bdbb64c22f35e0b11cf29ddb2597039baf475c01.tar.gz
Change from a hard coded temporary file name in lib/AnyDBM_File.t.
Previously lib/AnyDBM_File.t and lib/DBM_Filter/t/*t shared the same hard coded filename for their test database, causing a race condition during parallel testing, and some spurious test failures.
Diffstat (limited to 'lib/AnyDBM_File.t')
-rw-r--r--lib/AnyDBM_File.t15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/AnyDBM_File.t b/lib/AnyDBM_File.t
index cb9eee9760..43405b99a1 100644
--- a/lib/AnyDBM_File.t
+++ b/lib/AnyDBM_File.t
@@ -17,15 +17,16 @@ $Is_Dosish = ($^O eq 'amigaos' || $^O eq 'MSWin32' ||
$^O eq 'os2' || $^O eq 'mint' ||
$^O eq 'cygwin');
-unlink <Op_dbmx*>;
+my $filename = "Any_dbmx$$";
+unlink <"$filename*">;
umask(0);
-ok( tie(%h,AnyDBM_File,'Op_dbmx', O_RDWR|O_CREAT, 0640), "Tie");
+ok( tie(%h,AnyDBM_File,"$filename", O_RDWR|O_CREAT, 0640), "Tie");
-$Dfile = "Op_dbmx.pag";
+$Dfile = "$filename.pag";
if (! -e $Dfile) {
- ($Dfile) = <Op_dbmx*>;
+ ($Dfile) = <$filename*>;
}
SKIP:
@@ -63,7 +64,7 @@ $h{'goner2'} = 'snork';
delete $h{'goner2'};
untie(%h);
-ok(tie(%h,AnyDBM_File,'Op_dbmx', O_RDWR, 0640),"Re-tie hash");
+ok(tie(%h,AnyDBM_File,"$filename", O_RDWR, 0640),"Re-tie hash");
$h{'j'} = 'J';
$h{'k'} = 'K';
@@ -151,7 +152,7 @@ SKIP:
untie %h;
if ($^O eq 'VMS') {
- unlink 'Op_dbmx.sdbm_dir', $Dfile;
+ unlink "$filename.sdbm_dir", $Dfile;
} else {
- unlink 'Op_dbmx.dir', $Dfile;
+ unlink "$filename.dir", $Dfile;
}