diff options
author | Bjørn Erik Pedersen <[email protected]> | 2021-06-27 13:24:49 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2021-06-27 15:01:56 +0200 |
commit | 19aa95fc7f4cd58dcc8a8ff075762cfc86d41dc3 (patch) | |
tree | 59b96d8099fb7a18e7e55ba9a115163c9dea6043 /config/defaultConfigProvider_test.go | |
parent | 923dd9d1c1f649142f3f377109318b07e0f44d5d (diff) | |
download | hugo-19aa95fc7f4cd58dcc8a8ff075762cfc86d41dc3.tar.gz hugo-19aa95fc7f4cd58dcc8a8ff075762cfc86d41dc3.zip |
Fix config handling with empty config entries after merge
Fixes #8701
Diffstat (limited to 'config/defaultConfigProvider_test.go')
-rw-r--r-- | config/defaultConfigProvider_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/config/defaultConfigProvider_test.go b/config/defaultConfigProvider_test.go index 6752ab2e5..7ab8c049a 100644 --- a/config/defaultConfigProvider_test.go +++ b/config/defaultConfigProvider_test.go @@ -283,6 +283,26 @@ func TestDefaultConfigProvider(t *testing.T) { }) + // Issue #8701 + c.Run("Prevent _merge only maps", func(c *qt.C) { + cfg := New() + + cfg.Set("", map[string]interface{}{ + "B": "bv", + }) + + cfg.Merge("", map[string]interface{}{ + "c": map[string]interface{}{ + "_merge": "shallow", + "d": "dv2", + }, + }) + + c.Assert(cfg.Get(""), qt.DeepEquals, maps.Params{ + "b": "bv", + }) + }) + c.Run("IsSet", func(c *qt.C) { cfg := New() |