]> git.proxmox.com Git - rustc.git/blame - src/vendor/regex-0.2.11/tests/shortest_match.rs
New upstream version 1.31.0+dfsg1
[rustc.git] / src / vendor / regex-0.2.11 / tests / shortest_match.rs
CommitLineData
94b46f34
XL
1macro_rules! shortmat {
2 ($name:ident, $re:expr, $text:expr, $shortest_match:expr) => {
3 #[test]
4 fn $name() {
5 let text = text!($text);
6 let re = regex!($re);
7 assert_eq!($shortest_match, re.shortest_match(text));
8 }
9 }
10}
11
12shortmat!(t01, r"a+", r"aa", Some(1));
13// Test that the reverse suffix optimization gets it right.
14shortmat!(t02, r".*(?:abcd)+", r"abcdabcd", Some(4));