diff options
Diffstat (limited to 'tpl/collections/merge_test.go')
-rw-r--r-- | tpl/collections/merge_test.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tpl/collections/merge_test.go b/tpl/collections/merge_test.go index 57163a0d5..c18664e25 100644 --- a/tpl/collections/merge_test.go +++ b/tpl/collections/merge_test.go @@ -66,11 +66,25 @@ func TestMerge(t *testing.T) { map[string]interface{}{"a": 42, "c": 3}, maps.Params{"a": int(1), "b": int(2), "c": int(3)}, false}, { - // https://github.com/gohugoio/hugo/issues/6633 + "params dst, upper case src", + maps.Params{"a": 1, "b": 2}, + map[string]interface{}{"a": 42, "C": 3}, + maps.Params{"a": int(1), "b": int(2), "c": int(3)}, false}, + { "params src", map[string]interface{}{"a": 1, "c": 2}, maps.Params{"a": 42, "c": 3}, map[string]interface{}{"a": int(1), "c": int(2)}, false}, + { + "params src, upper case dst", + map[string]interface{}{"a": 1, "C": 2}, + maps.Params{"a": 42, "c": 3}, + map[string]interface{}{"a": int(1), "C": int(2)}, false}, + { + "nested, params dst", + maps.Params{"a": 1, "b": maps.Params{"d": 1, "e": 2}}, + map[string]interface{}{"a": 42, "c": 3, "b": map[string]interface{}{"d": 55, "e": 66, "f": 3}}, + maps.Params{"a": 1, "b": maps.Params{"d": 1, "e": 2, "f": 3}, "c": 3}, false}, {"src nil", simpleMap, nil, simpleMap, false}, // Error cases. {"dst not a map", "not a map", nil, nil, true}, |