(t testing.TB, conn *pgx.Conn, typename string)
| 136 | } |
| 137 | |
| 138 | func testJSONStringPointer(t testing.TB, conn *pgx.Conn, typename string) { |
| 139 | input := `{"key": "value"}` |
| 140 | expectedOutput := map[string]string{"key": "value"} |
| 141 | var output map[string]string |
| 142 | err := conn.QueryRow(context.Background(), "select $1::"+typename, &input).Scan(&output) |
| 143 | if err != nil { |
| 144 | t.Errorf("%s: QueryRow Scan failed: %v", typename, err) |
| 145 | return |
| 146 | } |
| 147 | |
| 148 | if !reflect.DeepEqual(expectedOutput, output) { |
| 149 | t.Errorf("%s: Did not transcode map[string]string successfully: %v is not %v", typename, expectedOutput, output) |
| 150 | return |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | func testJSONSingleLevelStringMap(t *testing.T, conn *pgx.Conn, typename string) { |
| 155 | input := map[string]string{"key": "value"} |
no test coverage detected