(t *testing.T)
| 2637 | } |
| 2638 | |
| 2639 | func TestParseErrorData(t *testing.T) { |
| 2640 | p := newTestParser(t) |
| 2641 | src := common.NewTextSource(`a.?b`) |
| 2642 | _, iss := p.Parse(src) |
| 2643 | if len(iss.GetErrors()) != 1 { |
| 2644 | t.Fatalf("Check() of a bad expression did produce a single error: %v", iss.ToDisplayString()) |
| 2645 | } |
| 2646 | celErr := iss.GetErrors()[0] |
| 2647 | if celErr.ExprID != 2 { |
| 2648 | t.Errorf("got exprID %v, wanted 2", celErr.ExprID) |
| 2649 | } |
| 2650 | if !strings.Contains(celErr.Message, "unsupported syntax") { |
| 2651 | t.Errorf("got message %v, wanted unsupported syntax", celErr.Message) |
| 2652 | } |
| 2653 | } |
| 2654 | |
| 2655 | func newTestParser(t *testing.T, options ...Option) *Parser { |
| 2656 | t.Helper() |
nothing calls this directly
no test coverage detected