MCPcopy Index your code
hub / github.com/rilldata/rill / TestLocationError

Function TestLocationError

runtime/parser/parser_test.go:418–455  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

416}
417
418func TestLocationError(t *testing.T) {
419 files := map[string]string{
420 // rill.yaml
421 `rill.yaml`: ``,
422 // source s1
423 `sources/s1.yaml`: `
424connector: s3
425path: hello
426 world: foo
427`,
428 // model m1
429 `/models/m1.sql`: `
430-- @materialize: true
431SELECT *
432
433FRO 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
457func TestReparse(t *testing.T) {
458 // Prepare

Callers

nothing calls this directly

Calls 3

makeRepoFunction · 0.85
ParseFunction · 0.70

Tested by

no test coverage detected