diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-10-17 08:24:45 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-10-17 08:25:57 +0200 |
commit | 0fe4ff18751156fa072e1f83077e49a8597e7dcd (patch) | |
tree | c24fa1895dcb57c0beb230298ac9ab14db5360f8 /hugolib/hugo_sites_build_errors_test.go | |
parent | 1f42e47e475c0cd684426dd230de411d4c385a3c (diff) |
tpl: Improve the Execute panic error message
See #5327
Diffstat (limited to 'hugolib/hugo_sites_build_errors_test.go')
-rw-r--r-- | hugolib/hugo_sites_build_errors_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/hugolib/hugo_sites_build_errors_test.go b/hugolib/hugo_sites_build_errors_test.go index 074220758..cf347a2d1 100644 --- a/hugolib/hugo_sites_build_errors_test.go +++ b/hugolib/hugo_sites_build_errors_test.go @@ -109,6 +109,18 @@ func TestSiteBuildErrors(t *testing.T) { a.assertLineNumber(2, err) }, },*/ + + { + name: "Panic in template Execute", + fileType: single, + fileFixer: func(content string) string { + return strings.Replace(content, ".Title", ".Parent.Parent.Parent", 1) + }, + assertBuildError: func(a testSiteBuildErrorAsserter, err error) { + assert.Error(err) + assert.Contains(err.Error(), "layouts/_default/single.html") + }, + }, } for _, test := range tests { |