Description: add feature fences Author: Jonas Smedegaard Author: Noisycoil Author: Peter Michael Green Bug-Debian: https://bugs.debian.org/1089894 Bug-Debian: https://bugs.debian.org/1089917 Bug-Debian: https://bugs.debian.org/1142699 Last-Update: 2024-12-14 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/tests/replace.rs +++ b/tests/replace.rs @@ -2,6 +2,7 @@ /// check replacement with a mut closure /// See https://github.com/Canop/lazy-regex/issues/27 #[test] +#[cfg(feature = "unicode-perl")] fn replace_with_mut_closure() { let input = "5+183/32"; let mut last_digits: Vec = Vec::new(); --- a/tests/regex_if.rs +++ b/tests/regex_if.rs @@ -6,6 +6,7 @@ }; #[test] +#[cfg(any(feature = "unicode", feature = "lite"))] fn test_regex_if() { fn extract_grey_level(s: &str) -> Option { regex_if!( @@ -21,6 +22,7 @@ } #[test] +#[cfg(any(feature = "unicode", feature = "lite"))] fn test_regex_if_with_error_handling() { fn extract_grey_level(s: &str) -> Result, ParseIntError> { let v = regex_if!(r#"^gr(a|e)y\((?\d{1,3})\)$"#, s, level.parse()?); @@ -32,7 +34,7 @@ } #[test] -#[cfg(not(feature = "lite"))] +#[cfg(all(feature = "unicode", not(feature = "lite")))] fn test_bytes_regex_if() { fn extract_grey_level(s: &[u8]) -> Option { lazy_regex::bytes_regex_if!( --- a/tests/regex_switch.rs +++ b/tests/regex_switch.rs @@ -6,6 +6,7 @@ }; #[test] +#[cfg(any(feature = "unicode", feature = "lite"))] fn test_regex_switch() { #[derive(Debug, PartialEq, Eq)] enum Color { @@ -34,6 +35,7 @@ } #[test] +#[cfg(any(feature = "unicode", feature = "lite"))] fn test_regex_switch_with_error_handling() -> Result<(), ParseIntError> { #[derive(Debug, PartialEq)] enum Color { @@ -58,7 +60,7 @@ } #[test] -#[cfg(not(feature = "lite"))] +#[cfg(all(feature = "unicode", not(feature = "lite")))] fn test_bytes_regex_switch() { #[derive(Debug, PartialEq, Eq)] enum Color { --- a/tests/remove.rs +++ b/tests/remove.rs @@ -3,6 +3,7 @@ }; #[test] +#[cfg(feature = "unicode-perl")] fn test_regex_remove() { let input = "154681string63731"; @@ -22,7 +23,7 @@ } #[test] -#[cfg(not(feature = "lite"))] +#[cfg(all(feature = "unicode-perl", not(feature = "lite")))] fn test_bytes_regex_remove() { let input = b"154681string63731"; @@ -34,6 +35,7 @@ } #[test] +#[cfg(feature = "unicode-perl")] fn test_regex_remove_all() { let input = "154681string63731"; @@ -89,7 +91,7 @@ } #[test] -#[cfg(not(feature = "lite"))] +#[cfg(all(feature = "unicode-perl", not(feature = "lite")))] fn test_bytes_regex_remove_all() { let input = b"154681string63731";