Commit 29a295eb authored by Adam Eijdenberg's avatar Adam Eijdenberg
Browse files

Add test for existing merging behaviour of mixed types


Signed-off-by: default avatarAdam Eijdenberg <adam.eijdenberg@digital.gov.au>
Showing with 24 additions and 0 deletions
+24 -0
...@@ -585,3 +585,27 @@ anotherNewKey: ...@@ -585,3 +585,27 @@ anotherNewKey:
} }
} }
} }
func TestOverriteTableItemWithNonTableValue(t *testing.T) {
// src has a table value for "foo"
src := map[string]interface{}{
"foo": map[string]interface{}{
"baz": "boz",
},
}
// dst has a non-table value for "foo"
dst := map[string]interface{}{
"foo": "bar",
}
// result - this may print a warning, but we has always "worked"
result := coalesceTables(dst, src, "")
expected := map[string]interface{}{
"foo": "bar",
}
if !reflect.DeepEqual(result, expected) {
t.Errorf("Expected %v, but got %v", expected, result)
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment