summaryrefslogtreecommitdiffstats
path: root/hugolib
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-10-24 14:02:34 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-10-24 15:19:49 +0200
commitacc14b4646d849e09e8da37552d4f4f777d0fce2 (patch)
tree4a4d4d63e77494897fead102331a06a733a34a22 /hugolib
parent2d7709d15584e4c11138cd7fe92717a2a58e4585 (diff)
hugolib: Adjust error test to make it pass on Go tip
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/hugo_sites_build_errors_test.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/hugolib/hugo_sites_build_errors_test.go b/hugolib/hugo_sites_build_errors_test.go
index 8c5016225..a5825b35f 100644
--- a/hugolib/hugo_sites_build_errors_test.go
+++ b/hugolib/hugo_sites_build_errors_test.go
@@ -3,6 +3,7 @@ package hugolib
import (
"fmt"
"path/filepath"
+ "runtime"
"strings"
"testing"
@@ -199,14 +200,23 @@ func TestSiteBuildErrors(t *testing.T) {
},
},
{
+ // See https://github.com/gohugoio/hugo/issues/5327
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(), `execute of template failed: panic in Execute`)
+ // This is fixed in latest Go source
+ if strings.Contains(runtime.Version(), "devel") {
+ fe := a.getFileError(err)
+ assert.Equal(5, fe.LineNumber)
+ assert.Equal(21, fe.ColumnNumber)
+ } else {
+ assert.Contains(err.Error(), `execute of template failed: panic in Execute`)
+ }
},
},
}