| 1 |
use regex_automata::{Input, Match}; |
| 2 |
|
| 3 |
mod multi_pattern_v2; |
| 4 |
|
| 5 |
#[test] |
| 6 |
fn multi_pattern_v2() { |
| 7 |
use multi_pattern_v2::MULTI_PATTERN_V2 as RE; |
| 8 |
|
| 9 |
assert_eq!(Some(Match::must(0, 0..4)), RE.find("abcd")); |
| 10 |
assert_eq!(Some(Match::must(0, 2..6)), RE.find("@ abcd @")); |
| 11 |
assert_eq!(Some(Match::must(1, 0..6)), RE.find("@abcd@")); |
| 12 |
assert_eq!(Some(Match::must(0, 1..5)), RE.find("\nabcd\n")); |
| 13 |
assert_eq!(Some(Match::must(0, 1..5)), RE.find("\nabcd wxyz\n")); |
| 14 |
assert_eq!(Some(Match::must(1, 1..7)), RE.find("\n@abcd@\n")); |
| 15 |
assert_eq!(Some(Match::must(2, 0..6)), RE.find("@abcd@\r\n")); |
| 16 |
assert_eq!(Some(Match::must(1, 2..8)), RE.find("\r\n@abcd@")); |
| 17 |
assert_eq!(Some(Match::must(2, 2..8)), RE.find("\r\n@abcd@\r\n")); |
| 18 |
|
| 19 |
// Fails because we have heuristic support for Unicode word boundaries |
| 20 |
// enabled. |
| 21 |
assert!(RE.try_search(&Input::new(b"\xFF@abcd@\xFF")).is_err()); |
| 22 |
} |