]>
git.proxmox.com Git - rustc.git/blob - vendor/regex-automata/tests/regression.rs
2 dfa
::{dense, Automaton}
,
6 // A regression test for checking that minimization correctly translates
7 // whether a state is a match state or not. Previously, it was possible for
8 // minimization to mark a non-matching state as matching.
10 fn minimize_sets_correct_match_states() {
12 // This is a subset of the grapheme matching regex. I couldn't seem
13 // to get a repro any smaller than this unfortunately.
21 (?:\p{gcb=V}+|\p{gcb=LV}\p{gcb=V}*|\p{gcb=LVT})
30 \p{Extended_Pictographic}
31 (?:\p{gcb=Extend}*\p{gcb=ZWJ}\p{Extended_Pictographic})*
33 [^\p{gcb=Control}\p{gcb=CR}\p{gcb=LF}]
35 [\p{gcb=Extend}\p{gcb=ZWJ}\p{gcb=SpacingMark}]*
39 let dfa
= dense
::Builder
::new()
40 .configure(dense
::Config
::new().anchored(true).minimize(true))
43 assert_eq
!(Ok(None
), dfa
.find_leftmost_fwd(b
"\xE2"));