Skip to content
Permalink
Browse files

hugolib: Adjust Go version specific test

See #6304
  • Loading branch information...
bep committed Sep 4, 2019
1 parent b431301 commit dc3f3df29d2b65532cedc9d321db7c4a38a28d7d
Showing with 3 additions and 10 deletions.
  1. +3 −10 hugolib/hugo_sites_build_errors_test.go
@@ -3,8 +3,6 @@ package hugolib
import (
"fmt"
"path/filepath"
"regexp"
"runtime"
"strings"
"testing"
"time"
@@ -212,14 +210,9 @@ func TestSiteBuildErrors(t *testing.T) {

assertBuildError: func(a testSiteBuildErrorAsserter, err error) {
a.c.Assert(err, qt.Not(qt.IsNil))
// This is fixed in latest Go source
if regexp.MustCompile("devel|12").MatchString(runtime.Version()) {
fe := a.getFileError(err)
a.c.Assert(fe.Position().LineNumber, qt.Equals, 5)
a.c.Assert(fe.Position().ColumnNumber, qt.Equals, 21)
} else {
a.c.Assert(err.Error(), qt.Contains, `execute of template failed: panic in Execute`)
}
fe := a.getFileError(err)
a.c.Assert(fe.Position().LineNumber, qt.Equals, 5)
a.c.Assert(fe.Position().ColumnNumber, qt.Equals, 21)
},
},
}

0 comments on commit dc3f3df

Please sign in to comment.
You can’t perform that action at this time.