handle empty pipeline name in lookup

This commit is contained in:
Brad Rydzewski
2019-10-30 15:52:10 -07:00
parent 5b1d8d65ed
commit cab335542b
2 changed files with 23 additions and 1 deletions

View File

@@ -43,3 +43,20 @@ func TestLookupNotFound(t *testing.T) {
t.Errorf("Expect resource not found error")
}
}
func TestNameMatch(t *testing.T) {
tests := []struct {
a, b string
match bool
}{
{"a", "b", false},
{"a", "a", true},
{"", "default", true},
}
for _, test := range tests {
got, want := isNameMatch(test.a, test.b), test.match
if got != want {
t.Errorf("Expect %q and %q match is %v", test.a, test.b, want)
}
}
}