mirror of https://github.com/jackc/pgx.git
copy tests: test all supported modes
if we run the test in parallel, we always test the latest mode see here https://github.com/golang/go/wiki/LoopvarExperiment also fix a lint warning about pgtype.Vec2pull/1648/head
parent
b1f8055584
commit
eb2807bda5
|
@ -17,8 +17,6 @@ import (
|
||||||
func TestConnCopyWithAllQueryExecModes(t *testing.T) {
|
func TestConnCopyWithAllQueryExecModes(t *testing.T) {
|
||||||
for _, mode := range pgxtest.AllQueryExecModes {
|
for _, mode := range pgxtest.AllQueryExecModes {
|
||||||
t.Run(mode.String(), func(t *testing.T) {
|
t.Run(mode.String(), func(t *testing.T) {
|
||||||
t.Parallel()
|
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
|
@ -81,8 +79,6 @@ func TestConnCopyWithKnownOIDQueryExecModes(t *testing.T) {
|
||||||
|
|
||||||
for _, mode := range pgxtest.KnownOIDQueryExecModes {
|
for _, mode := range pgxtest.KnownOIDQueryExecModes {
|
||||||
t.Run(mode.String(), func(t *testing.T) {
|
t.Run(mode.String(), func(t *testing.T) {
|
||||||
t.Parallel()
|
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
|
|
|
@ -1784,7 +1784,7 @@ func TestConnSimpleProtocol(t *testing.T) {
|
||||||
{
|
{
|
||||||
if conn.PgConn().ParameterStatus("crdb_version") == "" {
|
if conn.PgConn().ParameterStatus("crdb_version") == "" {
|
||||||
// CockroachDB doesn't support circle type.
|
// CockroachDB doesn't support circle type.
|
||||||
expected := pgtype.Circle{P: pgtype.Vec2{1, 2}, R: 1.5, Valid: true}
|
expected := pgtype.Circle{P: pgtype.Vec2{X: 1, Y: 2}, R: 1.5, Valid: true}
|
||||||
actual := expected
|
actual := expected
|
||||||
err := conn.QueryRow(
|
err := conn.QueryRow(
|
||||||
context.Background(),
|
context.Background(),
|
||||||
|
|
Loading…
Reference in New Issue