Fix config handling with empty config entries after merge

Fixes #8701
This commit is contained in:
Bjørn Erik Pedersen 2021-06-27 13:24:49 +02:00
parent 923dd9d1c1
commit 19aa95fc7f
4 changed files with 58 additions and 5 deletions

View file

@ -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()