aboutsummaryrefslogtreecommitdiffhomepage
path: root/config/defaultConfigProvider_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2021-06-27 13:24:49 +0200
committerBjørn Erik Pedersen <[email protected]>2021-06-27 15:01:56 +0200
commit19aa95fc7f4cd58dcc8a8ff075762cfc86d41dc3 (patch)
tree59b96d8099fb7a18e7e55ba9a115163c9dea6043 /config/defaultConfigProvider_test.go
parent923dd9d1c1f649142f3f377109318b07e0f44d5d (diff)
downloadhugo-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.go20
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()