Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
42
third-party/vendor/regex-automata-0.1.10/tests/regression.rs
vendored
Normal file
42
third-party/vendor/regex-automata-0.1.10/tests/regression.rs
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
use regex_automata::{dense, DFA};
|
||||
|
||||
// A regression test for checking that minimization correctly translates
|
||||
// whether a state is a match state or not. Previously, it was possible for
|
||||
// minimization to mark a non-matching state as matching.
|
||||
#[test]
|
||||
fn minimize_sets_correct_match_states() {
|
||||
let pattern =
|
||||
// This is a subset of the grapheme matching regex. I couldn't seem
|
||||
// to get a repro any smaller than this unfortunately.
|
||||
r"(?x)
|
||||
(?:
|
||||
\p{gcb=Prepend}*
|
||||
(?:
|
||||
(?:
|
||||
(?:
|
||||
\p{gcb=L}*
|
||||
(?:\p{gcb=V}+|\p{gcb=LV}\p{gcb=V}*|\p{gcb=LVT})
|
||||
\p{gcb=T}*
|
||||
)
|
||||
|
|
||||
\p{gcb=L}+
|
||||
|
|
||||
\p{gcb=T}+
|
||||
)
|
||||
|
|
||||
\p{Extended_Pictographic}
|
||||
(?:\p{gcb=Extend}*\p{gcb=ZWJ}\p{Extended_Pictographic})*
|
||||
|
|
||||
[^\p{gcb=Control}\p{gcb=CR}\p{gcb=LF}]
|
||||
)
|
||||
[\p{gcb=Extend}\p{gcb=ZWJ}\p{gcb=SpacingMark}]*
|
||||
)
|
||||
";
|
||||
|
||||
let dfa = dense::Builder::new()
|
||||
.minimize(true)
|
||||
.anchored(true)
|
||||
.build(pattern)
|
||||
.unwrap();
|
||||
assert_eq!(None, dfa.find(b"\xE2"));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue