(t *testing.T)
| 43 | } |
| 44 | |
| 45 | func TestBacktrackingStackLimitOverride(t *testing.T) { |
| 46 | for _, limit := range []int{200000, -1} { |
| 47 | t.Run(strconv.Itoa(limit), func(t *testing.T) { |
| 48 | re := MustCompile(`(?:^){60000}`, OptionMaxBacktrackingStackSize(limit)) |
| 49 | matched, err := re.MatchString("") |
| 50 | if err != nil { |
| 51 | t.Fatalf("MatchString failed: %v", err) |
| 52 | } |
| 53 | if !matched { |
| 54 | t.Fatal("MatchString did not match") |
| 55 | } |
| 56 | }) |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | func TestRunnerReusableAfterBacktrackingStackLimit(t *testing.T) { |
| 61 | re := MustCompile(`x|(?:^){100}`, OptionMaxBacktrackingStackSize(64)) |
nothing calls this directly
no test coverage detected