Bumping k8s dependencies to 1.13
This commit is contained in:
42
vendor/github.com/imdario/mergo/pr81_test.go
generated
vendored
Normal file
42
vendor/github.com/imdario/mergo/pr81_test.go
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
package mergo
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMapInterfaceWithMultipleLayer(t *testing.T) {
|
||||
m1 := map[string]interface{}{
|
||||
"k1": map[string]interface{}{
|
||||
"k1.1": "v1",
|
||||
},
|
||||
}
|
||||
|
||||
m2 := map[string]interface{}{
|
||||
"k1": map[string]interface{}{
|
||||
"k1.1": "v2",
|
||||
"k1.2": "v3",
|
||||
},
|
||||
}
|
||||
|
||||
if err := Map(&m1, m2, WithOverride); err != nil {
|
||||
t.Fatalf("Error merging: %v", err)
|
||||
}
|
||||
|
||||
// Check overwrite of sub map works
|
||||
expected := "v2"
|
||||
actual := m1["k1"].(map[string]interface{})["k1.1"].(string)
|
||||
if actual != expected {
|
||||
t.Fatalf("Expected %v but got %v",
|
||||
expected,
|
||||
actual)
|
||||
}
|
||||
|
||||
// Check new key is merged
|
||||
expected = "v3"
|
||||
actual = m1["k1"].(map[string]interface{})["k1.2"].(string)
|
||||
if actual != expected {
|
||||
t.Fatalf("Expected %v but got %v",
|
||||
expected,
|
||||
actual)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user