mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
hugolib: Adjust test for Go 1.12
This commit is contained in:
parent
908692fae5
commit
b4148cd1d9
1 changed files with 2 additions and 1 deletions
|
@ -3,6 +3,7 @@ package hugolib
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"regexp"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
@ -211,7 +212,7 @@ func TestSiteBuildErrors(t *testing.T) {
|
||||||
assertBuildError: func(a testSiteBuildErrorAsserter, err error) {
|
assertBuildError: func(a testSiteBuildErrorAsserter, err error) {
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
// This is fixed in latest Go source
|
// 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)
|
fe := a.getFileError(err)
|
||||||
assert.Equal(5, fe.Position().LineNumber)
|
assert.Equal(5, fe.Position().LineNumber)
|
||||||
assert.Equal(21, fe.Position().ColumnNumber)
|
assert.Equal(21, fe.Position().ColumnNumber)
|
||||||
|
|
Loading…
Reference in a new issue