X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Frgit.git;a=blobdiff_plain;f=t%2F20-each.t;fp=t%2F20-each.t;h=ed1c0c207e2392d87474c1568f22b6404d71f23f;hp=a3a26e5e4a827c6eefe9114ac48e747735e99a70;hb=20ecc90aa6c17a07fd1200d0bf72d5918e53e106;hpb=a35a1fae17b8e75696ef1e5474aaa99222594a6a diff --git a/t/20-each.t b/t/20-each.t index a3a26e5..ed1c0c2 100644 --- a/t/20-each.t +++ b/t/20-each.t @@ -3,9 +3,9 @@ use strict; use warnings; -use Cwd qw/cwd abs_path/; -use File::Spec::Functions qw/catdir catfile/; -use File::Temp qw/tempfile tempdir/; +use Cwd qw/cwd abs_path/; +use File::Spec (); # catdir, catfile +use File::Temp qw/tempfile tempdir/; use Test::More; @@ -33,7 +33,7 @@ sub build { while (my ($d, $v) = each %$tree) { if (ref $v) { - my $dir = catdir($prefix, $d); + my $dir = File::Spec->catdir($prefix, $d); mkdir $dir or die "mkdir($dir): $!"; my @r = build($v, $dir); @@ -43,12 +43,12 @@ sub build { push @ret, [ $_->[0], ref eq 'main' ? @{$_}[1 .. 3] - : map catdir($d, $_), @{$_}[1 .. 3] + : map File::Spec->catdir($d, $_), @{$_}[1 .. 3] ]; } } } else { - my $file = catfile($prefix, $d); + my $file = File::Spec->catfile($prefix, $d); open my $fh, '>', $file or die "open($file): $!"; print $fh $v; close $fh; @@ -67,8 +67,8 @@ my $repogit = { sub repo { my ($n, $bare) = @_; - return $bare ? [ $n, "$n.git", "$n.git", "$n.git" ] - : [ $n, catdir($n, '.git'), $n, "$n.git" ] + return $bare ? [ $n, "$n.git", "$n.git", "$n.git" ] + : [ $n, File::Spec->catdir($n, '.git'), $n, "$n.git" ] } my $tmpdir = tempdir(CLEANUP => 1); @@ -113,7 +113,7 @@ is grep({ ref eq 'ARRAY' } @expected), 3, 'all of them are array references'; @expected = map [ @$_, - map(catdir($tmpdir, $_), @{$_}[1 .. 3]), + map(File::Spec->catdir($tmpdir, $_), @{$_}[1 .. 3]), $tmpdir, '%n', '%x' ], @expected;