Skip line tests on when server version < PG 9.4

This commit is contained in:
Jack Christensen 2017-04-11 20:16:41 -05:00
parent 7b1f461ec3
commit 76c0b9ee90
2 changed files with 15 additions and 0 deletions

View File

@ -54,6 +54,7 @@ install:
- go get -u github.com/jackc/fake
- go get -u github.com/jackc/pgmock/pgmsg
- go get -u github.com/lib/pq
- go get -u github.com/hashicorp/go-version
script:
- go test -v -race ./...

View File

@ -3,10 +3,24 @@ package pgtype_test
import (
"testing"
version "github.com/hashicorp/go-version"
"github.com/jackc/pgx/pgtype"
)
func TestLineTranscode(t *testing.T) {
conn := mustConnectPgx(t)
serverVersion, err := version.NewVersion(conn.RuntimeParams["server_version"])
if err != nil {
t.Fatalf("cannot get server version: %v", err)
}
mustClose(t, conn)
minVersion := version.Must(version.NewVersion("9.4"))
if serverVersion.LessThan(minVersion) {
t.Skipf("Skipping line test for server version %v", serverVersion)
}
testSuccessfulTranscode(t, "line", []interface{}{
&pgtype.Line{
A: 1.23, B: 4.56, C: 7.89,