(t testing.TB, conn *pgx.Conn, typename string)
| 120 | } |
| 121 | |
| 122 | func testJSONString(t testing.TB, conn *pgx.Conn, typename string) { |
| 123 | input := `{"key": "value"}` |
| 124 | expectedOutput := map[string]string{"key": "value"} |
| 125 | var output map[string]string |
| 126 | err := conn.QueryRow(context.Background(), "select $1::"+typename, input).Scan(&output) |
| 127 | if err != nil { |
| 128 | t.Errorf("%s: QueryRow Scan failed: %v", typename, err) |
| 129 | return |
| 130 | } |
| 131 | |
| 132 | if !reflect.DeepEqual(expectedOutput, output) { |
| 133 | t.Errorf("%s: Did not transcode map[string]string successfully: %v is not %v", typename, expectedOutput, output) |
| 134 | return |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | func testJSONStringPointer(t testing.TB, conn *pgx.Conn, typename string) { |
| 139 | input := `{"key": "value"}` |
no test coverage detected