mirror of https://github.com/jackc/pgx.git
Skip test based on missing line type
Instead of explicit server version checking. Ubuntu installed version string is not parsable by go-version. e.g. 10.2 (Ubuntu 10.2-1.pgdg16.04+1)pull/400/head
parent
606697ffdf
commit
55ca9db5d5
|
@ -3,23 +3,14 @@ package pgtype_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
version "github.com/hashicorp/go-version"
|
||||
"github.com/jackc/pgx/pgtype"
|
||||
"github.com/jackc/pgx/pgtype/testutil"
|
||||
)
|
||||
|
||||
func TestLineTranscode(t *testing.T) {
|
||||
conn := testutil.MustConnectPgx(t)
|
||||
serverVersion, err := version.NewVersion(conn.RuntimeParams["server_version"])
|
||||
if err != nil {
|
||||
t.Fatalf("cannot get server version: %v", err)
|
||||
}
|
||||
testutil.MustClose(t, conn)
|
||||
|
||||
minVersion := version.Must(version.NewVersion("9.4"))
|
||||
|
||||
if serverVersion.LessThan(minVersion) {
|
||||
t.Skipf("Skipping line test for server version %v", serverVersion)
|
||||
if _, ok := conn.ConnInfo.DataTypeForName("line"); !ok {
|
||||
t.Skip("Skipping due to no line type")
|
||||
}
|
||||
|
||||
testutil.TestSuccessfulTranscode(t, "line", []interface{}{
|
||||
|
|
Loading…
Reference in New Issue