1 macro_rules! noparse( 2 ($name:ident, $re:expr) => ( 3 #[test] 4 fn $name() { 5 let re = $re; 6 match regex_new!(re) { 7 Err(_) => {}, 8 Ok(_) => panic!("Regex '{}' should cause a parse error.", re), 9 } 10 } 11 ); 12 ); 13 14 noparse!(fail_no_repeat_arg, "*"); 15 noparse!(fail_incomplete_escape, "\\"); 16 noparse!(fail_class_incomplete, "[A-"); 17 noparse!(fail_class_not_closed, "[A"); 18 noparse!(fail_class_no_begin, r"[\A]"); 19 noparse!(fail_class_no_end, r"[\z]"); 20 noparse!(fail_class_no_boundary, r"[\b]"); 21 noparse!(fail_open_paren, "("); 22 noparse!(fail_close_paren, ")"); 23 noparse!(fail_invalid_range, "[a-Z]"); 24 noparse!(fail_empty_capture_name, "(?P<>a)"); 25 noparse!(fail_bad_capture_name, "(?P<na-me>)"); 26 noparse!(fail_bad_flag, "(?a)a"); 27 noparse!(fail_too_big, "a{10000000}"); 28 noparse!(fail_counted_no_close, "a{1001"); 29 noparse!(fail_counted_decreasing, "a{2,1}"); 30 noparse!(fail_counted_nonnegative, "a{-1,1}"); 31 noparse!(fail_unfinished_cap, "(?"); 32 noparse!(fail_unfinished_escape, "\\"); 33 noparse!(fail_octal_digit, r"\8"); 34 noparse!(fail_hex_digit, r"\xG0"); 35 noparse!(fail_hex_short, r"\xF"); 36 noparse!(fail_hex_long_digits, r"\x{fffg}"); 37 noparse!(fail_flag_bad, "(?a)"); 38 noparse!(fail_flag_empty, "(?)"); 39 noparse!(fail_double_neg, "(?-i-i)"); 40 noparse!(fail_neg_empty, "(?i-)"); 41 noparse!(fail_dupe_named, "(?P<a>.)(?P<a>.)"); 42 noparse!(fail_range_end_no_class, "[a-[:lower:]]"); 43 noparse!(fail_range_end_no_begin, r"[a-\A]"); 44 noparse!(fail_range_end_no_end, r"[a-\z]"); 45 noparse!(fail_range_end_no_boundary, r"[a-\b]"); 46