diff --git a/tests/bytes.rs b/tests/bytes.rs index fc391b1a5e..3568ba005c 100644 --- a/tests/bytes.rs +++ b/tests/bytes.rs @@ -43,20 +43,20 @@ mat!(null_bytes, r"(?-u)(?P[^\x00]+)\x00", // Test that lookahead operators work properly in the face of invalid UTF-8. // See: /~https://github.com/rust-lang-nursery/regex/issues/277 matiter!(invalidutf8_anchor1, - r"\xcc?^", + r"(?-u)\xcc?^", R(b"\x8d#;\x1a\xa4s3\x05foobarX\\\x0f0t\xe4\x9b\xa4"), (0, 0)); matiter!(invalidutf8_anchor2, - r"^\xf7|4\xff\d\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a##########[] d\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a##########[] #####\x80\S7|$", + r"(?-u)^\xf7|4\xff\d\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a##########[] d\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a##########[] #####\x80\S7|$", R(b"\x8d#;\x1a\xa4s3\x05foobarX\\\x0f0t\xe4\x9b\xa4"), (22, 22)); matiter!(invalidutf8_anchor3, - r"^|ddp\xff\xffdddddlQd@\x80", + r"(?-u)^|ddp\xff\xffdddddlQd@\x80", R(b"\x8d#;\x1a\xa4s3\x05foobarX\\\x0f0t\xe4\x9b\xa4"), (0, 0)); // See /~https://github.com/rust-lang-nursery/regex/issues/303 #[test] fn negated_full_byte_range() { - assert!(::regex::bytes::Regex::new(r#"[^\x00-\xff]"#).is_err()); + assert!(::regex::bytes::Regex::new(r#"(?-u)[^\x00-\xff]"#).is_err()); } diff --git a/tests/regression.rs b/tests/regression.rs index 8484b9fe81..5961d66263 100644 --- a/tests/regression.rs +++ b/tests/regression.rs @@ -62,23 +62,23 @@ matiter!(word_boundary_dfa, r"\b", "a b c", matiter!(partial_anchor, r"^a|b", "ba", (0, 1)); // See: /~https://github.com/rust-lang-nursery/regex/issues/264 -mat!(ascii_boundary_no_capture, u!(r"(?-u)\B"), "\u{28f3e}", Some((0, 0))); -mat!(ascii_boundary_capture, u!(r"(?-u)(\B)"), "\u{28f3e}", Some((0, 0))); +mat!(ascii_boundary_no_capture, r"(?-u)\B", "\u{28f3e}", Some((0, 0))); +mat!(ascii_boundary_capture, r"(?-u)(\B)", "\u{28f3e}", Some((0, 0))); // See: /~https://github.com/rust-lang-nursery/regex/issues/280 -ismatch!(partial_anchor_alternate_begin, u!(r"^a|z"), "yyyyya", false); -ismatch!(partial_anchor_alternate_end, u!(r"a$|z"), "ayyyyy", false); +ismatch!(partial_anchor_alternate_begin, r"^a|z", "yyyyya", false); +ismatch!(partial_anchor_alternate_end, r"a$|z", "ayyyyy", false); // See: /~https://github.com/rust-lang-nursery/regex/issues/289 -mat!(lits_unambiguous1, u!(r"(ABC|CDA|BC)X"), "CDAX", Some((0, 4))); +mat!(lits_unambiguous1, r"(ABC|CDA|BC)X", "CDAX", Some((0, 4))); // See: /~https://github.com/rust-lang-nursery/regex/issues/291 -mat!(lits_unambiguous2, u!(r"((IMG|CAM|MG|MB2)_|(DSCN|CIMG))(?P[0-9]+)$"), +mat!(lits_unambiguous2, r"((IMG|CAM|MG|MB2)_|(DSCN|CIMG))(?P[0-9]+)$", "CIMG2341", Some((0, 8)), Some((0, 4)), None, Some((0, 4)), Some((4, 8))); // See: /~https://github.com/rust-lang-nursery/regex/issues/271 -mat!(end_not_wb, u!(r"$(?-u:\B)"), "\u{5c124}\u{b576c}", Some((8, 8))); -mat!(endl_or_wb, u!(r"(?m:$)|(?-u:\b)"), "\u{6084e}", Some((4, 4))); -mat!(zero_or_end, u!(r"(?i-u:\x00)|$"), "\u{e682f}", Some((4, 4))); -mat!(y_or_endl, u!(r"(?i-u:y)|(?m:$)"), "\u{b4331}", Some((4, 4))); -mat!(wb_start_x, u!(r"(?u:\b)^(?-u:X)"), "X", Some((0, 1))); +mat!(end_not_wb, r"$(?-u:\B)", "\u{5c124}\u{b576c}", Some((8, 8))); +mat!(endl_or_wb, r"(?m:$)|(?-u:\b)", "\u{6084e}", Some((4, 4))); +mat!(zero_or_end, r"(?i-u:\x00)|$", "\u{e682f}", Some((4, 4))); +mat!(y_or_endl, r"(?i-u:y)|(?m:$)", "\u{b4331}", Some((4, 4))); +mat!(wb_start_x, r"(?u:\b)^(?-u:X)", "X", Some((0, 1))); diff --git a/tests/test_backtrack.rs b/tests/test_backtrack.rs index 7861a3db88..5516c840e7 100644 --- a/tests/test_backtrack.rs +++ b/tests/test_backtrack.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![cfg_attr(feature = "pattern", feature(pattern))] + extern crate rand; extern crate regex; diff --git a/tests/test_backtrack_utf8bytes.rs b/tests/test_backtrack_utf8bytes.rs index 2bf9456292..a170d19324 100644 --- a/tests/test_backtrack_utf8bytes.rs +++ b/tests/test_backtrack_utf8bytes.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![cfg_attr(feature = "pattern", feature(pattern))] + extern crate rand; extern crate regex; diff --git a/tests/test_default.rs b/tests/test_default.rs index 452872d35d..e6cf92fa2e 100644 --- a/tests/test_default.rs +++ b/tests/test_default.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![cfg_attr(feature = "pattern", feature(pattern))] + extern crate rand; extern crate regex; diff --git a/tests/test_nfa.rs b/tests/test_nfa.rs index abf24561fd..8a831c47d3 100644 --- a/tests/test_nfa.rs +++ b/tests/test_nfa.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![cfg_attr(feature = "pattern", feature(pattern))] + extern crate rand; extern crate regex; diff --git a/tests/test_nfa_bytes.rs b/tests/test_nfa_bytes.rs index a084c804fe..f376cefe1f 100644 --- a/tests/test_nfa_bytes.rs +++ b/tests/test_nfa_bytes.rs @@ -1,4 +1,3 @@ - // Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. diff --git a/tests/test_nfa_utf8bytes.rs b/tests/test_nfa_utf8bytes.rs index 5926de7bd6..5d13685aab 100644 --- a/tests/test_nfa_utf8bytes.rs +++ b/tests/test_nfa_utf8bytes.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![cfg_attr(feature = "pattern", feature(pattern))] + extern crate rand; extern crate regex;