Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions std/regex/internal/tests.d
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,17 @@ debug(std_regex_test) import std.stdio;
debug(std_regex_test) writeln("!!! FReD C-T test done !!!");
}

// Force the backtracking engine to exercise it on every pattern.
auto bmatchForced(R, RegEx)(R input, RegEx re)
{
import std.regex.internal.ir : RuntimeFactory, BasicElementOf;
import std.regex.internal.backtracking : BacktrackingMatcher;
alias Char = BasicElementOf!R;
return match(input, re.withFactory(new RuntimeFactory!(BacktrackingMatcher, Char)));
}

ct_tests();
run_tests!bmatch(); //backtracker
run_tests!match(); //thompson VM
run_tests!match(); // engine auto-selected per pattern
run_tests!bmatchForced(); // force the backtracking engine on every pattern
}

Loading