(t *testing.T)
| 277 | } |
| 278 | |
| 279 | func TestExecFailure(t *testing.T) { |
| 280 | t.Parallel() |
| 281 | |
| 282 | ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second) |
| 283 | defer cancel() |
| 284 | |
| 285 | pgxtest.RunWithQueryExecModes(ctx, t, defaultConnTestRunner, nil, func(ctx context.Context, t testing.TB, conn *pgx.Conn) { |
| 286 | if _, err := conn.Exec(context.Background(), "selct;"); err == nil { |
| 287 | t.Fatal("Expected SQL syntax error") |
| 288 | } |
| 289 | |
| 290 | rows, _ := conn.Query(context.Background(), "select 1") |
| 291 | rows.Close() |
| 292 | if rows.Err() != nil { |
| 293 | t.Fatalf("Exec failure appears to have broken connection: %v", rows.Err()) |
| 294 | } |
| 295 | }) |
| 296 | } |
| 297 | |
| 298 | func TestExecFailureWithArguments(t *testing.T) { |
| 299 | t.Parallel() |
nothing calls this directly
no test coverage detected