summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2011-05-20 07:36:53 -0500
committerCraig A. Berry <craigberry@mac.com>2011-05-20 07:36:53 -0500
commit3df5101b1783b3f7e6ff145a0a810c25c512f8c5 (patch)
treeb7393347a14fd01535e5e9073f2ea5a0e5cdf866 /t
parent04718b4750d41e3e11d98b8fe58a782f1e1595da (diff)
downloadperl-3df5101b1783b3f7e6ff145a0a810c25c512f8c5.tar.gz
Filename portability for hash-rt85026.t
File::Temp::tempdir returns a directory in native syntax. You can't just paste a file onto that in Unix syntax and expect it to work.
Diffstat (limited to 't')
-rw-r--r--t/op/hash-rt85026.t10
1 files changed, 6 insertions, 4 deletions
diff --git a/t/op/hash-rt85026.t b/t/op/hash-rt85026.t
index 61c0fb4c97..b7d0cc66f4 100644
--- a/t/op/hash-rt85026.t
+++ b/t/op/hash-rt85026.t
@@ -10,20 +10,22 @@ BEGIN {
use strict;
use Devel::Peek;
use File::Temp qw(tempdir);
+use File::Spec;
my %hash = map +($_ => 1), ("a".."z");
my $tmp_dir = tempdir(CLEANUP => 1);
+my $tmp_file = File::Spec->catfile($tmp_dir, 'dump');
sub riter {
local *OLDERR;
open(OLDERR, ">&STDERR") || die "Can't dup STDERR: $!";
- open(STDERR, ">", "$tmp_dir/dump") ||
- die "Could not open '$tmp_dir/dump' for write: $^E";
+ open(STDERR, ">", $tmp_file) ||
+ die "Could not open '$tmp_file' for write: $^E";
Dump(\%hash);
open(STDERR, ">&OLDERR") || die "Can't dup OLDERR: $!";
- open(my $fh, "<", "$tmp_dir/dump") ||
- die "Could not open '$tmp_dir/dump' for read: $^E";
+ open(my $fh, "<", $tmp_file) ||
+ die "Could not open '$tmp_file' for read: $^E";
local $/;
my $dump = <$fh>;
my ($riter) = $dump =~ /^\s*RITER\s*=\s*(\d+)/m or