7
7
"io/ioutil"
8
8
"net/url"
9
9
"os"
10
- "path"
10
+ "path/filepath "
11
11
"strings"
12
12
"testing"
13
13
@@ -763,7 +763,7 @@ func TestFileArgs(t *testing.T) {
763
763
tmpFile1 := mkTempFile (t , "" , "" , "test1" )
764
764
tmpFile2 := mkTempFile (t , tmpDir1 , "" , "toBeIgnored" )
765
765
tmpFile3 := mkTempFile (t , tmpDir1 , "" , "test3" )
766
- ignoreFile := mkTempFile (t , tmpDir2 , "" , path .Base (tmpFile2 .Name ()))
766
+ ignoreFile := mkTempFile (t , tmpDir2 , "" , filepath .Base (tmpFile2 .Name ()))
767
767
tmpHiddenFile := mkTempFile (t , tmpDir1 , ".test_hidden_file_*" , "test" )
768
768
defer func () {
769
769
for _ , f := range []string {
@@ -790,27 +790,27 @@ func TestFileArgs(t *testing.T) {
790
790
parseErr : fmt .Errorf ("argument %q is required" , "path" ),
791
791
},
792
792
{
793
- cmd : words {"fileOp" , "--ignore" , path .Base (tmpFile2 .Name ()), tmpDir1 , tmpFile1 .Name ()}, f : nil ,
793
+ cmd : words {"fileOp" , "--ignore" , filepath .Base (tmpFile2 .Name ()), tmpDir1 , tmpFile1 .Name ()}, f : nil ,
794
794
args : words {tmpDir1 , tmpFile1 .Name (), tmpFile3 .Name ()},
795
795
parseErr : fmt .Errorf (notRecursiveFmtStr , tmpDir1 , "r" ),
796
796
},
797
797
{
798
- cmd : words {"fileOp" , tmpFile1 .Name (), "--ignore" , path .Base (tmpFile2 .Name ()), "--ignore" }, f : nil ,
798
+ cmd : words {"fileOp" , tmpFile1 .Name (), "--ignore" , filepath .Base (tmpFile2 .Name ()), "--ignore" }, f : nil ,
799
799
args : words {tmpDir1 , tmpFile1 .Name (), tmpFile3 .Name ()},
800
800
parseErr : fmt .Errorf ("missing argument for option %q" , "ignore" ),
801
801
},
802
802
{
803
- cmd : words {"fileOp" , "-r" , "--ignore" , path .Base (tmpFile2 .Name ()), tmpDir1 , tmpFile1 .Name ()}, f : nil ,
803
+ cmd : words {"fileOp" , "-r" , "--ignore" , filepath .Base (tmpFile2 .Name ()), tmpDir1 , tmpFile1 .Name ()}, f : nil ,
804
804
args : words {tmpDir1 , tmpFile1 .Name (), tmpFile3 .Name ()},
805
805
parseErr : nil ,
806
806
},
807
807
{
808
- cmd : words {"fileOp" , "--hidden" , "-r" , "--ignore" , path .Base (tmpFile2 .Name ()), tmpDir1 , tmpFile1 .Name ()}, f : nil ,
808
+ cmd : words {"fileOp" , "--hidden" , "-r" , "--ignore" , filepath .Base (tmpFile2 .Name ()), tmpDir1 , tmpFile1 .Name ()}, f : nil ,
809
809
args : words {tmpDir1 , tmpFile1 .Name (), tmpFile3 .Name (), tmpHiddenFile .Name ()},
810
810
parseErr : nil ,
811
811
},
812
812
{
813
- cmd : words {"fileOp" , "-r" , "--ignore" , path .Base (tmpFile2 .Name ()), tmpDir1 , tmpFile1 .Name (), "--ignore" , "anotherRule" }, f : nil ,
813
+ cmd : words {"fileOp" , "-r" , "--ignore" , filepath .Base (tmpFile2 .Name ()), tmpDir1 , tmpFile1 .Name (), "--ignore" , "anotherRule" }, f : nil ,
814
814
args : words {tmpDir1 , tmpFile1 .Name (), tmpFile3 .Name ()},
815
815
parseErr : nil ,
816
816
},
@@ -838,7 +838,7 @@ func TestFileArgs(t *testing.T) {
838
838
}
839
839
expectedFileMap := make (map [string ]bool )
840
840
for _ , arg := range tc .args {
841
- expectedFileMap [path .Base (arg )] = false
841
+ expectedFileMap [filepath .Base (arg )] = false
842
842
}
843
843
it := req .Files .Entries ()
844
844
for it .Next () {
0 commit comments