diff --git a/cid_test.go b/cid_test.go index 0dfc56d4..924e4cf3 100644 --- a/cid_test.go +++ b/cid_test.go @@ -20,9 +20,6 @@ func TestCIDTranscode(t *testing.T) { testutil.TestPgxSuccessfulTranscodeEqFunc(t, pgTypeName, values, eqFunc) - // No direct conversion from int to cid, convert through text - testutil.TestPgxSimpleProtocolSuccessfulTranscodeEqFunc(t, "text::"+pgTypeName, values, eqFunc) - for _, driverName := range []string{"github.com/lib/pq", "github.com/jackc/pgx/stdlib"} { testutil.TestDatabaseSQLSuccessfulTranscodeEqFunc(t, driverName, pgTypeName, values, eqFunc) } diff --git a/testutil/testutil.go b/testutil/testutil.go index 6ea3a69e..462549a7 100644 --- a/testutil/testutil.go +++ b/testutil/testutil.go @@ -98,7 +98,6 @@ func TestSuccessfulTranscode(t testing.TB, pgTypeName string, values []interface func TestSuccessfulTranscodeEqFunc(t testing.TB, pgTypeName string, values []interface{}, eqFunc func(a, b interface{}) bool) { TestPgxSuccessfulTranscodeEqFunc(t, pgTypeName, values, eqFunc) - TestPgxSimpleProtocolSuccessfulTranscodeEqFunc(t, pgTypeName, values, eqFunc) for _, driverName := range []string{"github.com/lib/pq", "github.com/jackc/pgx/stdlib"} { TestDatabaseSQLSuccessfulTranscodeEqFunc(t, driverName, pgTypeName, values, eqFunc) } @@ -150,35 +149,6 @@ func TestPgxSuccessfulTranscodeEqFunc(t testing.TB, pgTypeName string, values [] } } -func TestPgxSimpleProtocolSuccessfulTranscodeEqFunc(t testing.TB, pgTypeName string, values []interface{}, eqFunc func(a, b interface{}) bool) { - conn := MustConnectPgx(t) - defer MustCloseContext(t, conn) - - for i, v := range values { - // Derefence value if it is a pointer - derefV := v - refVal := reflect.ValueOf(v) - if refVal.Kind() == reflect.Ptr { - derefV = refVal.Elem().Interface() - } - - result := reflect.New(reflect.TypeOf(derefV)) - err := conn.QueryRow( - context.Background(), - fmt.Sprintf("select ($1)::%s", pgTypeName), - &pgx.QueryExOptions{SimpleProtocol: true}, - v, - ).Scan(result.Interface()) - if err != nil { - t.Errorf("Simple protocol %d: %v", i, err) - } - - if !eqFunc(result.Elem().Interface(), derefV) { - t.Errorf("Simple protocol %d: expected %v, got %v", i, derefV, result.Elem().Interface()) - } - } -} - func TestDatabaseSQLSuccessfulTranscodeEqFunc(t testing.TB, driverName, pgTypeName string, values []interface{}, eqFunc func(a, b interface{}) bool) { conn := MustConnectDatabaseSQL(t, driverName) defer MustClose(t, conn) diff --git a/xid_test.go b/xid_test.go index d0f3f0ab..594d1214 100644 --- a/xid_test.go +++ b/xid_test.go @@ -20,9 +20,6 @@ func TestXIDTranscode(t *testing.T) { testutil.TestPgxSuccessfulTranscodeEqFunc(t, pgTypeName, values, eqFunc) - // No direct conversion from int to xid, convert through text - testutil.TestPgxSimpleProtocolSuccessfulTranscodeEqFunc(t, "text::"+pgTypeName, values, eqFunc) - for _, driverName := range []string{"github.com/lib/pq", "github.com/jackc/pgx/stdlib"} { testutil.TestDatabaseSQLSuccessfulTranscodeEqFunc(t, driverName, pgTypeName, values, eqFunc) }