(t *testing.T)
| 2394 | } |
| 2395 | |
| 2396 | func TestParseErrorData(t *testing.T) { |
| 2397 | p := newTestParser(t) |
| 2398 | src := common.NewTextSource(`a.?b`) |
| 2399 | _, iss := p.Parse(src) |
| 2400 | if len(iss.GetErrors()) != 1 { |
| 2401 | t.Fatalf("Check() of a bad expression did produce a single error: %v", iss.ToDisplayString()) |
| 2402 | } |
| 2403 | celErr := iss.GetErrors()[0] |
| 2404 | if celErr.ExprID != 2 { |
| 2405 | t.Errorf("got exprID %v, wanted 2", celErr.ExprID) |
| 2406 | } |
| 2407 | if !strings.Contains(celErr.Message, "unsupported syntax") { |
| 2408 | t.Errorf("got message %v, wanted unsupported syntax", celErr.Message) |
| 2409 | } |
| 2410 | } |
| 2411 | |
| 2412 | func newTestParser(t *testing.T, options ...Option) *Parser { |
| 2413 | t.Helper() |
nothing calls this directly
no test coverage detected