Skip to content

Commit

Permalink
Add some more reduction tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub committed Nov 15, 2021
1 parent 585a7a0 commit 0199b5a
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,13 @@ private static int GetMinRequiredLength(Regex r)
[InlineData("[^\n]*", ".*")]
[InlineData("(?>[^\n]*)", "(?>.*)")]
[InlineData("[^\n]*?", ".*?")]
// Set reduction
[InlineData("[\u0001-\uFFFF]", "[^\u0000]")]
[InlineData("[\u0000-\uFFFE]", "[^\uFFFF]")]
[InlineData("[\u0000-AB-\uFFFF]", "[\u0000-\uFFFF]")]
[InlineData("[ABC-EG-J]", "[A-EG-J]")]
[InlineData("[\u0000-AC-\uFFFF]", "[^B]")]
[InlineData("[\u0000-AF-\uFFFF]", "[^B-E]")]
// Large loop patterns
[InlineData("a*a*a*a*a*a*a*b*b*?a+a*", "a*b*b*?a+")]
[InlineData("a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "a{0,30}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")]
Expand Down

0 comments on commit 0199b5a

Please sign in to comment.