mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
added test case for different length keys/values
This commit is contained in:
@@ -342,6 +342,20 @@ func TestElementSetterList(t *testing.T) {
|
||||
- e: f
|
||||
- g: h
|
||||
`, assertNoErrorString(t)(node.String()))
|
||||
|
||||
node = orig.Copy()
|
||||
// Should return an error
|
||||
// keys and values are not the same length
|
||||
newElement = NewMapRNode(&map[string]string{
|
||||
"g": "h",
|
||||
})
|
||||
rn, err = node.Pipe(ElementSetterList{
|
||||
Keys: []string{"a", "c"},
|
||||
Values: []string{"b"},
|
||||
Element: newElement.YNode(),
|
||||
})
|
||||
assert.Error(t, err)
|
||||
assert.Nil(t, rn)
|
||||
}
|
||||
|
||||
func TestElementMatcherWithNoValue(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user