@@ -41,34 +41,38 @@ func TestParsePackageStrings(t *testing.T) {
4141 expectErr bool
4242 inputPaths []string
4343 remote int
44- local int
44+ files int
45+ dirs int
4546 }{
46- "allLocal" : {expectErr : false , inputPaths : []string {"test-data" , "." }, remote : 0 , local : 2 },
47+ "allDirs" : {expectErr : false , inputPaths : []string {"test-data" , "." }, remote : 0 , files : 0 , dirs : 2 },
48+ "allFiles" : {expectErr : false , inputPaths : []string {"test-data/valid.yaml" }, remote : 0 , files : 1 , dirs : 0 },
4749 "allRemote" : {expectErr : false , inputPaths : []string {
4850 "https://github.com/kubernetes-sigs/kustomize//examples/multibases/dev/?timeout=120&ref=v3.3.1" ,
4951 "git@github.com:owner/repo//examples" ,
50- }, remote : 2 , local : 0 },
52+ }, remote : 2 , files : 0 , dirs : 0 },
5153 "mix" : {expectErr : false , inputPaths : []string {
5254 "https://github.com/kubernetes-sigs/kustomize//examples/multibases/dev/?timeout=120&ref=v3.3.1" ,
5355 "test-data" ,
54- }, remote : 1 , local : 1 },
56+ "test-data/valid.yaml" ,
57+ }, remote : 1 , files : 1 , dirs : 1 },
5558 "invalidLocalPath" : {expectErr : true , inputPaths : []string {
5659 "does-not-exist" ,
57- }, remote : 0 , local : 0 },
60+ }, remote : 0 , files : 0 , dirs : 0 },
5861 "invalidRemotePath" : {expectErr : true , inputPaths : []string {
5962 "https:// github.com/kubernetes-sigs/kustomize//examples" ,
60- }, remote : 0 , local : 0 },
63+ }, remote : 0 , files : 0 , dirs : 0 },
6164 }
6265
6366 for k := range cases {
6467 c := cases [k ]
65- remote , local , err := ParsePackageStrings (c .inputPaths )
68+ remote , files , dirs , err := ParsePackageStrings (c .inputPaths )
6669 if cases [k ].expectErr {
6770 assert .NotNil (t , err )
6871 } else {
6972 assert .Nil (t , err )
7073 }
7174 assert .Equal (t , c .remote , len (remote ))
72- assert .Equal (t , c .local , len (local ))
75+ assert .Equal (t , c .files , len (files ))
76+ assert .Equal (t , c .dirs , len (dirs ))
7377 }
7478}
0 commit comments