aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl
diff options
context:
space:
mode:
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']")
}