(t *testing.T)
| 2376 | } |
| 2377 | |
| 2378 | func TestParseErrorData(t *testing.T) { |
| 2379 | p := newTestParser(t) |
| 2380 | src := common.NewTextSource(`a.?b`) |
| 2381 | _, iss := p.Parse(src) |
| 2382 | if len(iss.GetErrors()) != 1 { |
| 2383 | t.Fatalf("Check() of a bad expression did produce a single error: %v", iss.ToDisplayString()) |
| 2384 | } |
| 2385 | celErr := iss.GetErrors()[0] |
| 2386 | if celErr.ExprID != 2 { |
| 2387 | t.Errorf("got exprID %v, wanted 2", celErr.ExprID) |
| 2388 | } |
| 2389 | if !strings.Contains(celErr.Message, "unsupported syntax") { |
| 2390 | t.Errorf("got message %v, wanted unsupported syntax", celErr.Message) |
| 2391 | } |
| 2392 | } |
| 2393 | |
| 2394 | func newTestParser(t *testing.T, options ...Option) *Parser { |
| 2395 | t.Helper() |
nothing calls this directly
no test coverage detected