hugolib: Adjust Go version specific test
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 4 Sep 2019 07:50:32 +0000 (09:50 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 4 Sep 2019 07:50:32 +0000 (09:50 +0200)
See #6304

hugolib/hugo_sites_build_errors_test.go

index 6c9c8b0893b10db89682db334d7d2c8e88596214..21b745ccd84c62004f372528e90c0092fa6c26c3 100644 (file)
@@ -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)
                        },
                },
        }