Skip to content

Commit

Permalink
fuzz: add regression test
Browse files Browse the repository at this point in the history
This adds a regression test for a bug found in the *old* regex crate
that isn't present with the regex-automata rewrite. I discovered this
while doing differential fuzzing. I didn't do a root cause analysis of
the bug, but my guess is a literal optimization problem.
  • Loading branch information
BurntSushi committed May 22, 2023
1 parent 5f866f5 commit 11b9494
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions testdata/regression.toml
Original file line number Diff line number Diff line change
Expand Up @@ -719,3 +719,12 @@ name = "negated-unicode-word-boundary-dfa-fail"
regex = '\B.*'
haystack = "!\u02D7"
matches = [[0, 3]]

# This failure was found in the *old* regex crate (prior to regex 1.9), but
# I didn't investigate why. My best guess is that it's a literal optimization
# bug. It didn't occur in the rewrite.
[[test]]
name = "missed-match"
regex = 'e..+e.ee>'
haystack = 'Zeee.eZZZZZZZZeee>eeeeeee>'
matches = [[1, 26]]

0 comments on commit 11b9494

Please sign in to comment.