aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-06-22 18:41:18 +0200
committerBjørn Erik Pedersen <[email protected]>2024-06-22 19:01:56 +0200
commit8731d8822216dd3c7587769e3cf5d98690717b0c (patch)
tree8661a711d403756c65c1a8a3bea0bdbc5aa8b12f /tpl
parent3b724462c24b6824c8ac4a3a9ec8dbe274809032 (diff)
downloadhugo-8731d8822216dd3c7587769e3cf5d98690717b0c.tar.gz
hugo-8731d8822216dd3c7587769e3cf5d98690717b0c.zip
Fix Erroridf/Warnidf mixed case issue
Fixes #12617
Diffstat (limited to 'tpl')
-rw-r--r--tpl/fmt/fmt_integration_test.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/tpl/fmt/fmt_integration_test.go b/tpl/fmt/fmt_integration_test.go
index 74322770e..87a89943c 100644
--- a/tpl/fmt/fmt_integration_test.go
+++ b/tpl/fmt/fmt_integration_test.go
@@ -27,16 +27,22 @@ func TestErroridf(t *testing.T) {
files := `
-- hugo.toml --
disableKinds = ['page','rss','section','sitemap','taxonomy','term']
-ignoreErrors = ['error-b']
+ignoreErrors = ['error-b','error-C']
-- layouts/index.html --
{{ erroridf "error-a" "%s" "a"}}
{{ erroridf "error-b" "%s" "b"}}
+{{ erroridf "error-C" "%s" "C"}}
+{{ erroridf "error-c" "%s" "c"}}
+ {{ erroridf "error-d" "%s" "D"}}
`
b, err := hugolib.TestE(t, files)
b.Assert(err, qt.IsNotNil)
- b.AssertLogMatches(`^ERROR a\nYou can suppress this error by adding the following to your site configuration:\nignoreLogs = \['error-a'\]\n$`)
+ b.AssertLogMatches(`ERROR a\nYou can suppress this error by adding the following to your site configuration:\nignoreLogs = \['error-a'\]`)
+ b.AssertLogMatches(`ERROR D`)
+ b.AssertLogMatches(`! ERROR C`)
+ b.AssertLogMatches(`! ERROR c`)
}
func TestWarnidf(t *testing.T) {
@@ -45,13 +51,15 @@ func TestWarnidf(t *testing.T) {
files := `
-- hugo.toml --
disableKinds = ['page','rss','section','sitemap','taxonomy','term']
-ignoreLogs = ['warning-b']
+ignoreLogs = ['warning-b', 'WarniNg-C']
-- layouts/index.html --
{{ warnidf "warning-a" "%s" "a"}}
{{ warnidf "warning-b" "%s" "b"}}
+{{ warnidf "warNing-C" "%s" "c"}}
`
b := hugolib.Test(t, files, hugolib.TestOptWarn())
b.AssertLogContains("WARN a", "You can suppress this warning", "ignoreLogs", "['warning-a']")
- b.AssertLogNotContains("['warning-b']")
+ b.AssertLogContains("! ['warning-b']")
+ b.AssertLogContains("! ['warning-c']")
}