config: Fix env override of slices

Fixes #13707
This commit is contained in:
Bjørn Erik Pedersen
2025-05-11 11:54:34 +02:00
parent c745a3e108
commit bc98e7a80d
2 changed files with 59 additions and 26 deletions

View File

@@ -357,3 +357,25 @@ All.
b.Assert(b.H.Conf.DefaultContentLanguage(), qt.Equals, "sv")
}
func TestDefaultConfigEnvDisableLanguagesIssue13707(t *testing.T) {
t.Parallel()
files := `
-- hugo.toml --
disableLanguages = []
[languages]
[languages.en]
weight = 1
[languages.nn]
weight = 2
[languages.sv]
weight = 3
`
b := hugolib.Test(t, files, hugolib.TestOptWithConfig(func(conf *hugolib.IntegrationTestConfig) {
conf.Environ = []string{`HUGO_DISABLELANGUAGES=sv nn`}
}))
b.Assert(len(b.H.Sites), qt.Equals, 1)
}