(t *testing.T)
| 416 | } |
| 417 | |
| 418 | func TestLocationError(t *testing.T) { |
| 419 | files := map[string]string{ |
| 420 | // rill.yaml |
| 421 | `rill.yaml`: ``, |
| 422 | // source s1 |
| 423 | `sources/s1.yaml`: ` |
| 424 | connector: s3 |
| 425 | path: hello |
| 426 | world: foo |
| 427 | `, |
| 428 | // model m1 |
| 429 | `/models/m1.sql`: ` |
| 430 | -- @materialize: true |
| 431 | SELECT * |
| 432 | |
| 433 | FRO m1 |
| 434 | `, |
| 435 | } |
| 436 | |
| 437 | errors := []*runtimev1.ParseError{ |
| 438 | { |
| 439 | Message: " mapping values are not allowed in this context", |
| 440 | FilePath: "/sources/s1.yaml", |
| 441 | StartLocation: &runtimev1.CharLocation{Line: 4}, |
| 442 | }, |
| 443 | { |
| 444 | Message: "syntax error at or near \"m1\"", |
| 445 | FilePath: "/models/m1.sql", |
| 446 | StartLocation: &runtimev1.CharLocation{Line: 5}, |
| 447 | }, |
| 448 | } |
| 449 | |
| 450 | ctx := context.Background() |
| 451 | repo := makeRepo(t, files) |
| 452 | p, err := Parse(ctx, repo, "", "", "duckdb", true) |
| 453 | require.NoError(t, err) |
| 454 | requireResourcesAndErrors(t, p, nil, errors) |
| 455 | } |
| 456 | |
| 457 | func TestReparse(t *testing.T) { |
| 458 | // Prepare |
nothing calls this directly
no test coverage detected