pgx/pgtype/line_test.go
Jack Christensen 55ca9db5d5 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)
2018-02-16 21:39:19 -06:00

28 lines
556 B
Go

package pgtype_test
import (
"testing"
"github.com/jackc/pgx/pgtype"
"github.com/jackc/pgx/pgtype/testutil"
)
func TestLineTranscode(t *testing.T) {
conn := testutil.MustConnectPgx(t)
if _, ok := conn.ConnInfo.DataTypeForName("line"); !ok {
t.Skip("Skipping due to no line type")
}
testutil.TestSuccessfulTranscode(t, "line", []interface{}{
&pgtype.Line{
A: 1.23, B: 4.56, C: 7.89,
Status: pgtype.Present,
},
&pgtype.Line{
A: -1.23, B: -4.56, C: -7.89,
Status: pgtype.Present,
},
&pgtype.Line{Status: pgtype.Null},
})
}