Fix error handling for the time func alias

Fixes #8835
This commit is contained in:
Bjørn Erik Pedersen
2021-08-01 12:50:37 +02:00
parent 4d221ce468
commit 6c70e1f22f
53 changed files with 122 additions and 65 deletions

View File

@@ -203,3 +203,14 @@ timeZone = "America/LosAngeles" # Should be America/Los_Angeles
b.Assert(err, qt.Not(qt.IsNil))
b.Assert(err.Error(), qt.Contains, `failed to load config: invalid timeZone for language "en": unknown time zone America/LosAngeles`)
}
// Issue 8835
func TestTimeOnError(t *testing.T) {
b := newTestSitesBuilder(t)
b.WithTemplates("index.html", `time: {{ time "2020-10-20" "invalid-timezone" }}`)
b.WithContent("p1.md", "")
b.Assert(b.BuildE(BuildCfg{}), qt.Not(qt.IsNil))
}