github.com/jackc/pgx/v5@v5.5.5/pgtype/lseg_test.go (about) 1 package pgtype_test 2 3 import ( 4 "context" 5 "testing" 6 7 "github.com/jackc/pgx/v5/pgtype" 8 "github.com/jackc/pgx/v5/pgxtest" 9 ) 10 11 func TestLsegTranscode(t *testing.T) { 12 skipCockroachDB(t, "Server does not support type lseg") 13 14 pgxtest.RunValueRoundTripTests(context.Background(), t, defaultConnTestRunner, nil, "lseg", []pgxtest.ValueRoundTripTest{ 15 { 16 pgtype.Lseg{ 17 P: [2]pgtype.Vec2{{3.14, 1.678}, {7.1, 5.2345678901}}, 18 Valid: true, 19 }, 20 new(pgtype.Lseg), 21 isExpectedEq(pgtype.Lseg{ 22 P: [2]pgtype.Vec2{{3.14, 1.678}, {7.1, 5.2345678901}}, 23 Valid: true, 24 }), 25 }, 26 { 27 pgtype.Lseg{ 28 P: [2]pgtype.Vec2{{7.1, 1.678}, {-13.14, -5.234}}, 29 Valid: true, 30 }, 31 new(pgtype.Lseg), 32 isExpectedEq(pgtype.Lseg{ 33 P: [2]pgtype.Vec2{{7.1, 1.678}, {-13.14, -5.234}}, 34 Valid: true, 35 }), 36 }, 37 {pgtype.Lseg{}, new(pgtype.Lseg), isExpectedEq(pgtype.Lseg{})}, 38 {nil, new(pgtype.Lseg), isExpectedEq(pgtype.Lseg{})}, 39 }) 40 }