mirror of
https://github.com/jackc/pgx.git
synced 2025-05-31 11:42:24 +00:00
Skip line tests on when server version < PG 9.4
This commit is contained in:
parent
7b1f461ec3
commit
76c0b9ee90
@ -54,6 +54,7 @@ install:
|
|||||||
- go get -u github.com/jackc/fake
|
- go get -u github.com/jackc/fake
|
||||||
- go get -u github.com/jackc/pgmock/pgmsg
|
- go get -u github.com/jackc/pgmock/pgmsg
|
||||||
- go get -u github.com/lib/pq
|
- go get -u github.com/lib/pq
|
||||||
|
- go get -u github.com/hashicorp/go-version
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- go test -v -race ./...
|
- go test -v -race ./...
|
||||||
|
@ -3,10 +3,24 @@ package pgtype_test
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
version "github.com/hashicorp/go-version"
|
||||||
"github.com/jackc/pgx/pgtype"
|
"github.com/jackc/pgx/pgtype"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestLineTranscode(t *testing.T) {
|
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{}{
|
testSuccessfulTranscode(t, "line", []interface{}{
|
||||||
&pgtype.Line{
|
&pgtype.Line{
|
||||||
A: 1.23, B: 4.56, C: 7.89,
|
A: 1.23, B: 4.56, C: 7.89,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user