Codebase list rust-libslirp / 457f5d7 src / regex-automata / debian / patches / ignore-std-tests.patch
457f5d7

Tree @457f5d7 (Download .tar.gz)

ignore-std-tests.patch @457f5d7raw · history · blame

--- a/src/dense.rs
+++ b/src/dense.rs
@@ -119,7 +119,7 @@
 /// This type implements the [`DFA`](trait.DFA.html) trait, which means it
 /// can be used for searching. For example:
 ///
-/// ```
+#[cfg_attr(feature = "std", doc = "```")] #[cfg_attr(not(feature = "std"), doc = "```ignore")]
 /// use regex_automata::{DFA, DenseDFA};
 ///
 /// # fn example() -> Result<(), regex_automata::Error> {
@@ -502,7 +502,7 @@
     /// decrease the size of the DFA and to avoid platform specific pitfalls
     /// such as differing pointer sizes.
     ///
-    /// ```
+    #[cfg_attr(feature = "std", doc = "```")] #[cfg_attr(not(feature = "std"), doc = "```ignore")]
     /// use regex_automata::{DFA, DenseDFA};
     ///
     /// # fn example() -> Result<(), regex_automata::Error> {
@@ -2246,6 +2246,7 @@
     String::from_utf8(ascii::escape_default(b).collect::<Vec<_>>()).unwrap()
 }
 
+#[cfg(feature = "std")]
 #[cfg(test)]
 #[allow(dead_code)]
 mod tests {
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -10,7 +10,10 @@
 extern crate serde_derive;
 extern crate toml;
 
+#[cfg(feature = "std")]
 mod collection;
+#[cfg(feature = "std")]
 mod regression;
+#[cfg(feature = "std")]
 mod suite;
 mod unescape;
--- a/src/dfa.rs
+++ b/src/dfa.rs
@@ -78,7 +78,7 @@
     /// This example shows how to use this method with a
     /// [`DenseDFA`](enum.DenseDFA.html).
     ///
-    /// ```
+    #[cfg_attr(feature = "std", doc = "```")] #[cfg_attr(not(feature = "std"), doc = "```ignore")]
     /// use regex_automata::{DFA, DenseDFA};
     ///
     /// # fn example() -> Result<(), regex_automata::Error> {
@@ -104,7 +104,7 @@
     /// This example shows how to use this method with a
     /// [`DenseDFA`](enum.DenseDFA.html).
     ///
-    /// ```
+    #[cfg_attr(feature = "std", doc = "```")] #[cfg_attr(not(feature = "std"), doc = "```ignore")]
     /// use regex_automata::{DFA, DenseDFA};
     ///
     /// # fn example() -> Result<(), regex_automata::Error> {
@@ -153,7 +153,7 @@
     /// both `Sam|Samwise` and `Samwise|Sam` match `Samwise` when using
     /// leftmost longest semantics.
     ///
-    /// ```
+    #[cfg_attr(feature = "std", doc = "```")] #[cfg_attr(not(feature = "std"), doc = "```ignore")]
     /// use regex_automata::{DFA, DenseDFA};
     ///
     /// # fn example() -> Result<(), regex_automata::Error> {
@@ -187,7 +187,7 @@
     /// `find` and `rfind` with the same DFA since any particular DFA will only
     /// support searching in one direction.
     ///
-    /// ```
+    #[cfg_attr(feature = "std", doc = "```")] #[cfg_attr(not(feature = "std"), doc = "```ignore")]
     /// use regex_automata::{dense, DFA};
     ///
     /// # fn example() -> Result<(), regex_automata::Error> {
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -29,7 +29,7 @@
 This example shows how to compile a regex using the default configuration
 and then use it to find matches in a byte string:
 
-```
+*/#![cfg_attr(feature = "std", doc = "```")] #![cfg_attr(not(feature = "std"), doc = "```ignore")]/*!
 use regex_automata::Regex;
 
 let re = Regex::new(r"[0-9]{4}-[0-9]{2}-[0-9]{2}").unwrap();
@@ -48,7 +48,7 @@
 Using sparse DFAs is as easy as using `Regex::new_sparse` instead of
 `Regex::new`:
 
-```
+*/#![cfg_attr(feature = "std", doc = "```")] #![cfg_attr(not(feature = "std"), doc = "```ignore")]/*!
 use regex_automata::Regex;
 
 # fn example() -> Result<(), regex_automata::Error> {
@@ -62,7 +62,7 @@
 If you already have dense DFAs for some reason, they can be converted to sparse
 DFAs and used to build a new `Regex`. For example:
 
-```
+*/#![cfg_attr(feature = "std", doc = "```")] #![cfg_attr(not(feature = "std"), doc = "```ignore")]/*!
 use regex_automata::Regex;
 
 # fn example() -> Result<(), regex_automata::Error> {
@@ -86,7 +86,7 @@
 deserialization is guaranteed to be cheap because it will always be a constant
 time operation.
 
-```
+*/#![cfg_attr(feature = "std", doc = "```")] #![cfg_attr(not(feature = "std"), doc = "```ignore")]/*!
 use regex_automata::{DenseDFA, Regex};
 
 # fn example() -> Result<(), regex_automata::Error> {
@@ -139,7 +139,7 @@
 
 The same process can be achieved with sparse DFAs as well:
 
-```
+*/#![cfg_attr(feature = "std", doc = "```")] #![cfg_attr(not(feature = "std"), doc = "```ignore")]/*!
 use regex_automata::{SparseDFA, Regex};
 
 # fn example() -> Result<(), regex_automata::Error> {
--- a/src/regex.rs
+++ b/src/regex.rs
@@ -86,7 +86,7 @@
 /// enough to build corresponding sparse DFAs, and then build a regex from
 /// them:
 ///
-/// ```
+#[cfg_attr(feature = "std", doc = "```")] #[cfg_attr(not(feature = "std"), doc = "```ignore")]
 /// use regex_automata::Regex;
 ///
 /// # fn example() -> Result<(), regex_automata::Error> {
@@ -179,7 +179,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    #[cfg_attr(feature = "std", doc = "```")] #[cfg_attr(not(feature = "std"), doc = "```ignore")]
     /// use regex_automata::Regex;
     ///
     /// # fn example() -> Result<(), regex_automata::Error> {
@@ -201,7 +201,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    #[cfg_attr(feature = "std", doc = "```")] #[cfg_attr(not(feature = "std"), doc = "```ignore")]
     /// use regex_automata::Regex;
     ///
     /// # fn example() -> Result<(), regex_automata::Error> {
@@ -235,7 +235,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    #[cfg_attr(feature = "std", doc = "```")] #[cfg_attr(not(feature = "std"), doc = "```ignore")]
     /// use regex_automata::Regex;
     ///
     /// # fn example() -> Result<(), regex_automata::Error> {
@@ -313,7 +313,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    #[cfg_attr(feature = "std", doc = "```")] #[cfg_attr(not(feature = "std"), doc = "```ignore")]
     /// use regex_automata::Regex;
     ///
     /// # fn example() -> Result<(), regex_automata::Error> {
@@ -342,7 +342,7 @@
     /// would involve serializing `initial_re` somewhere and then deserializing
     /// it later to build a regex.
     ///
-    /// ```
+    #[cfg_attr(feature = "std", doc = "```")] #[cfg_attr(not(feature = "std"), doc = "```ignore")]
     /// use regex_automata::Regex;
     ///
     /// # fn example() -> Result<(), regex_automata::Error> {
@@ -358,7 +358,7 @@
     /// This example shows how you might build smaller DFAs, and then use those
     /// smaller DFAs to build a new regex.
     ///
-    /// ```
+    #[cfg_attr(feature = "std", doc = "```")] #[cfg_attr(not(feature = "std"), doc = "```ignore")]
     /// use regex_automata::Regex;
     ///
     /// # fn example() -> Result<(), regex_automata::Error> {
@@ -375,7 +375,7 @@
     /// This example shows how to build a `Regex` that uses sparse DFAs instead
     /// of dense DFAs:
     ///
-    /// ```
+    #[cfg_attr(feature = "std", doc = "```")] #[cfg_attr(not(feature = "std"), doc = "```ignore")]
     /// use regex_automata::Regex;
     ///
     /// # fn example() -> Result<(), regex_automata::Error> {
--- a/src/sparse.rs
+++ b/src/sparse.rs
@@ -86,7 +86,7 @@
 /// This type implements the [`DFA`](trait.DFA.html) trait, which means it
 /// can be used for searching. For example:
 ///
-/// ```
+#[cfg_attr(feature = "std", doc = "```")] #[cfg_attr(not(feature = "std"), doc = "```ignore")]
 /// use regex_automata::{DFA, SparseDFA};
 ///
 /// # fn example() -> Result<(), regex_automata::Error> {
@@ -393,7 +393,7 @@
     /// decrease the size of the DFA and to avoid platform specific pitfalls
     /// such as differing pointer sizes.
     ///
-    /// ```
+    #[cfg_attr(feature = "std", doc = "```")] #[cfg_attr(not(feature = "std"), doc = "```ignore")]
     /// use regex_automata::{DFA, DenseDFA, SparseDFA};
     ///
     /// # fn example() -> Result<(), regex_automata::Error> {