(t *testing.T)
| 296 | } |
| 297 | |
| 298 | func TestExecFailureWithArguments(t *testing.T) { |
| 299 | t.Parallel() |
| 300 | |
| 301 | ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second) |
| 302 | defer cancel() |
| 303 | |
| 304 | pgxtest.RunWithQueryExecModes(ctx, t, defaultConnTestRunner, nil, func(ctx context.Context, t testing.TB, conn *pgx.Conn) { |
| 305 | _, err := conn.Exec(context.Background(), "selct $1;", 1) |
| 306 | if err == nil { |
| 307 | t.Fatal("Expected SQL syntax error") |
| 308 | } |
| 309 | assert.False(t, pgconn.SafeToRetry(err)) |
| 310 | |
| 311 | _, err = conn.Exec(context.Background(), "select $1::varchar(1);", "1", "2") |
| 312 | require.Error(t, err) |
| 313 | }) |
| 314 | } |
| 315 | |
| 316 | func TestExecContextWithoutCancelation(t *testing.T) { |
| 317 | t.Parallel() |
nothing calls this directly
no test coverage detected