(t *testing.T)
| 2303 | } |
| 2304 | |
| 2305 | func TestExpressionSizeCodePointLimit(t *testing.T) { |
| 2306 | p, err := NewParser(Macros(AllMacros...), ExpressionSizeCodePointLimit((2))) |
| 2307 | if err != nil { |
| 2308 | t.Fatal(err) |
| 2309 | } |
| 2310 | src := common.NewTextSource("foo") |
| 2311 | _, errs := p.Parse(src) |
| 2312 | if got, want := len(errs.GetErrors()), 1; got != want { |
| 2313 | t.Fatalf("got %d errors, want %d errors: %s", got, want, errs.ToDisplayString()) |
| 2314 | } |
| 2315 | if got, want := errs.GetErrors()[0].Message, "expression code point size exceeds limit: size: 3, limit 2"; got != want { |
| 2316 | t.Fatalf("got %q, want %q: %s", got, want, errs.GetErrors()[0].ToDisplayString(src)) |
| 2317 | } |
| 2318 | } |
| 2319 | |
| 2320 | func TestParserOptionErrors(t *testing.T) { |
| 2321 | if _, err := NewParser(Macros(AllMacros...), MaxRecursionDepth(-2)); err == nil { |
nothing calls this directly
no test coverage detected