config: Fix _merge issue when key doesn't exist on the left side

Fixes #13643
Fixes #13646
This commit is contained in:
Bjørn Erik Pedersen
2025-04-23 16:27:14 +02:00
parent 61a286595e
commit 179aea11ac
7 changed files with 165 additions and 90 deletions

View File

@@ -475,7 +475,7 @@ name = "menu-theme"
})
})
// Issue #8724
// Issue #8724 ##13643
for _, mergeStrategy := range []string{"none", "shallow"} {
c.Run(fmt.Sprintf("Merge with sitemap config in theme, mergestrategy %s", mergeStrategy), func(c *qt.C) {
smapConfigTempl := `[sitemap]
@@ -495,7 +495,7 @@ name = "menu-theme"
b.Assert(got.Sitemap, qt.DeepEquals, config.SitemapConfig{ChangeFreq: "", Disable: false, Priority: -1, Filename: "sitemap.xml"})
b.AssertFileContent("public/sitemap.xml", "schemas/sitemap")
} else {
b.Assert(got.Sitemap, qt.DeepEquals, config.SitemapConfig{ChangeFreq: "monthly", Disable: false, Priority: -1, Filename: "sitemap.xml"})
b.Assert(got.Sitemap, qt.DeepEquals, config.SitemapConfig{ChangeFreq: "monthly", Disable: false, Priority: 0.5, Filename: "sitemap.xml"})
b.AssertFileContent("public/sitemap.xml", "<changefreq>monthly</changefreq>")
}
})