hugolib: Adjust test for Go 1.12

This commit is contained in:
Bjørn Erik Pedersen 2019-02-19 21:47:03 +01:00
parent 908692fae5
commit b4148cd1d9
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -3,6 +3,7 @@ package hugolib
import (
"fmt"
"path/filepath"
"regexp"
"runtime"
"strings"
"testing"
@ -211,7 +212,7 @@ func TestSiteBuildErrors(t *testing.T) {
assertBuildError: func(a testSiteBuildErrorAsserter, err error) {
assert.Error(err)
// This is fixed in latest Go source
if strings.Contains(runtime.Version(), "devel") {
if regexp.MustCompile("devel|12").MatchString(runtime.Version()) {
fe := a.getFileError(err)
assert.Equal(5, fe.Position().LineNumber)
assert.Equal(21, fe.Position().ColumnNumber)