(t *testing.T)
| 32 | } |
| 33 | |
| 34 | func TestDefaultBacktrackingStackLimit(t *testing.T) { |
| 35 | re := MustCompile(`(?:^){60000}`) |
| 36 | matched, err := re.MatchString("") |
| 37 | if matched { |
| 38 | t.Fatal("MatchString unexpectedly matched") |
| 39 | } |
| 40 | if !errors.Is(err, ErrBacktrackingStackLimit) { |
| 41 | t.Fatalf("MatchString error = %v, want ErrBacktrackingStackLimit", err) |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | func TestBacktrackingStackLimitOverride(t *testing.T) { |
| 46 | for _, limit := range []int{200000, -1} { |
nothing calls this directly
no test coverage detected