Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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()