X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Frgit.git;a=blobdiff_plain;f=t%2F20-each.t;h=a5ac4d3e167846900984a49b0457a2dd37349f8d;hp=a3a26e5e4a827c6eefe9114ac48e747735e99a70;hb=HEAD;hpb=a35a1fae17b8e75696ef1e5474aaa99222594a6a diff --git a/t/20-each.t b/t/20-each.t index a3a26e5..a5ac4d3 100644 --- a/t/20-each.t +++ b/t/20-each.t @@ -3,18 +3,18 @@ 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; +use File::Spec (); # catdir, catfile +use File::Temp qw; use Test::More; -use App::Rgit::Utils qw/:codes/; +use App::Rgit::Utils qw<:codes>; use App::Rgit; use lib 't/lib'; -use App::Rgit::TestUtils qw/can_run_git/; +use App::Rgit::TestUtils qw; use App::Rgit::Policy::Callback; my ($can_run, $reason) = can_run_git; @@ -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; @@ -132,7 +132,7 @@ sub try { git => 't/bin/git', root => $tmpdir, cmd => $cmd, - args => [ abs_path($filename), $cmd, qw/%n %g %w %b %G %W %B %R %%n %x/ ], + args => [ abs_path($filename), $cmd, qw<%n %g %w %b %G %W %B %R %%n %x> ], policy => $policy, ); isa_ok $ar, 'App::Rgit', "each $cmd is an App::Rgit object";