Permalink
Browse files

join done

  • Loading branch information...
1 parent bf5f5d3 commit 67baf4d83206e423897d1fdc71c43ea9833724b1 @FROGGS committed Sep 14, 2012
Showing with 10 additions and 5 deletions.
  1. +1 −1 lib/File/Spec.pm
  2. +2 −2 lib/File/Spec/Unix.pm
  3. +7 −2 t/01_unix.t
View
@@ -30,7 +30,7 @@ class File::Spec {
method case_tolerant { ::($module).case_tolerant() }
method file_name_is_absolute( $file ) { ::($module).file_name_is_absolute( $file ) }
method path { ::($module).path() }
- method join { ::($module).join() }
+ method join( *@parts ) { ::($module).join( @parts ) }
method splitpath { ::($module).splitpath() }
method splitdir { ::($module).splitdir() }
method catpath { ::($module).catpath() }
View
@@ -84,8 +84,8 @@ class File::Spec::Unix {
return @path
}
- method join {
-
+ method join( @parts ) {
+ self.catfile( @parts )
}
method splitpath {
View
@@ -3,7 +3,7 @@ use lib 'lib';
use Test;
use File::Spec;
-plan 32;
+plan 37;
if $*OS ~~ any(<MacOS MSWin32 os2 VMS epoc NetWare symbian dos cygwin>) {
skip_rest 'this is not Unix\'ish'
@@ -62,7 +62,12 @@ else {
is_deeply File::Spec.path, @want, 'path';
%*ENV{'PATH'} = $path;
- #join
+ is File::Spec.join('a','b','c'), 'a/b/c', "join: ('a','b','c') -> 'a/b/c'";
+ is File::Spec.join('a','b','./c'), 'a/b/c', "join: ('a','b','./c') -> 'a/b/c'";
+ is File::Spec.join('./a','b','c'), 'a/b/c', "join: ('./a','b','c') -> 'a/b/c'";
+ is File::Spec.join('c'), 'c', "join: 'c' -> 'c'";
+ is File::Spec.join('./c'), 'c', "join: './c' -> 'c'";
+
#splitpath
#splitdir
#catpath

0 comments on commit 67baf4d

Please sign in to comment.