Description: add feature fences
Author: Jonas Smedegaard <dr@jones.dk>
Author: Noisycoil <noisycoil@tutanota.com>
Author: Peter Michael Green <plugwash@debian.org>
Bug-Debian: https://bugs.debian.org/1089894
Bug-Debian: https://bugs.debian.org/1089917
Last-Update: 2024-12-14
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -233,7 +233,7 @@
     once_cell::sync::Lazy,
 };
 
-#[cfg(not(feature = "lite"))]
+#[cfg(all(not(feature = "lite"), feature = "regex"))]
 pub use {
     regex::{
         self,
--- 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<u8> = Vec::new();
--- a/tests/regex_if.rs
+++ b/tests/regex_if.rs
@@ -7,6 +7,7 @@
 };
 
 #[test]
+#[cfg(any(feature = "unicode", feature = "lite"))]
 fn test_regex_if() {
     fn extract_grey_level(s: &str) -> Option<u16> {
         regex_if!(
@@ -22,6 +23,7 @@
 }
 
 #[test]
+#[cfg(any(feature = "unicode", feature = "lite"))]
 fn test_regex_if_with_error_handling() {
     fn extract_grey_level(s: &str) -> Result<Option<u8>, ParseIntError> {
         let v = regex_if!(r#"^gr(a|e)y\((?<level>\d{1,3})\)$"#, s, level.parse()?);
@@ -33,6 +35,7 @@
 }
 
 #[test]
+#[cfg(all(feature = "unicode", not(feature = "lite")))]
 fn test_bytes_regex_if() {
     fn extract_grey_level(s: &[u8]) -> Option<u16> {
         bytes_regex_if!(
--- a/tests/regex_switch.rs
+++ b/tests/regex_switch.rs
@@ -4,6 +4,7 @@
 };
 
 #[test]
+#[cfg(any(feature = "unicode", feature = "lite"))]
 fn test_regex_switch() {
     #[derive(Debug, PartialEq, Eq)]
     enum Color {
@@ -32,6 +33,7 @@
 }
 
 #[test]
+#[cfg(any(feature = "unicode", feature = "lite"))]
 fn test_regex_switch_with_error_handling() -> Result<(), ParseIntError> {
     #[derive(Debug, PartialEq)]
     enum Color {
@@ -56,6 +58,7 @@
 }
 
 #[test]
+#[cfg(all(feature = "unicode", not(feature = "lite")))]
 fn test_bytes_regex_switch() {
     #[derive(Debug, PartialEq, Eq)]
     enum Color {
