mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 09:24:23 +00:00
Add glob support in edit add resource
This commit is contained in:
@@ -18,6 +18,7 @@ package fs
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -90,3 +91,20 @@ func TestWriteFile(t *testing.T) {
|
||||
t.Fatalf("incorrect content: %v", content)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGlob(t *testing.T) {
|
||||
x := MakeFakeFS()
|
||||
x.Create("dir/foo")
|
||||
x.Create("dir/bar")
|
||||
files, err := x.Glob("dir/*")
|
||||
if err != nil {
|
||||
t.Fatalf("expected no error")
|
||||
}
|
||||
expected := []string{
|
||||
"dir/bar",
|
||||
"dir/foo",
|
||||
}
|
||||
if !reflect.DeepEqual(files, expected) {
|
||||
t.Fatalf("incorrect files found by glob: %v", files)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user