TODO - move these tests to pgtype
(t *testing.T)
| 83 | // TODO - move these tests to pgtype |
| 84 | |
| 85 | func TestJSONAndJSONBTranscode(t *testing.T) { |
| 86 | t.Parallel() |
| 87 | |
| 88 | ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second) |
| 89 | defer cancel() |
| 90 | |
| 91 | pgxtest.RunWithQueryExecModes(ctx, t, defaultConnTestRunner, nil, func(ctx context.Context, t testing.TB, conn *pgx.Conn) { |
| 92 | for _, typename := range []string{"json", "jsonb"} { |
| 93 | if _, ok := conn.TypeMap().TypeForName(typename); !ok { |
| 94 | continue // No JSON/JSONB type -- must be running against old PostgreSQL |
| 95 | } |
| 96 | |
| 97 | testJSONString(t, conn, typename) |
| 98 | testJSONStringPointer(t, conn, typename) |
| 99 | } |
| 100 | }) |
| 101 | } |
| 102 | |
| 103 | func TestJSONAndJSONBTranscodeExtendedOnly(t *testing.T) { |
| 104 | t.Parallel() |
nothing calls this directly
no test coverage detected