Implement defer

Closes #8086
Closes #12589
This commit is contained in:
Bjørn Erik Pedersen
2024-06-08 11:52:22 +02:00
parent 8731d88222
commit 6cd0784e44
33 changed files with 1033 additions and 148 deletions

View File

@@ -628,3 +628,20 @@ title: "A page"
b.CreateSites().BuildFail(BuildCfg{})
}
func TestErrorTemplateRuntime(t *testing.T) {
t.Parallel()
files := `
-- hugo.toml --
-- layouts/index.html --
Home.
{{ .ThisDoesNotExist }}
`
b, err := TestE(t, files)
b.Assert(err, qt.Not(qt.IsNil))
b.Assert(err.Error(), qt.Contains, filepath.FromSlash(`/layouts/index.html:2:3`))
b.Assert(err.Error(), qt.Contains, `can't evaluate field ThisDoesNotExist`)
}