summaryrefslogtreecommitdiffstats
path: root/vendor/regex-automata/tests/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/regex-automata/tests/tests.rs')
-rw-r--r--vendor/regex-automata/tests/tests.rs65
1 files changed, 42 insertions, 23 deletions
diff --git a/vendor/regex-automata/tests/tests.rs b/vendor/regex-automata/tests/tests.rs
index fb4cd7717..e4728470c 100644
--- a/vendor/regex-automata/tests/tests.rs
+++ b/vendor/regex-automata/tests/tests.rs
@@ -1,25 +1,44 @@
-#[cfg(feature = "std")]
-#[macro_use]
-extern crate lazy_static;
-#[cfg(feature = "std")]
-extern crate regex;
-#[cfg(feature = "std")]
-extern crate regex_automata;
-#[cfg(feature = "std")]
-extern crate serde;
-#[cfg(feature = "std")]
-extern crate serde_bytes;
-#[cfg(feature = "std")]
-#[macro_use]
-extern crate serde_derive;
-#[cfg(feature = "std")]
-extern crate toml;
+#![allow(warnings)]
-#[cfg(feature = "std")]
-mod collection;
-#[cfg(feature = "std")]
+use regex_test::RegexTests;
+
+mod dfa;
+mod hybrid;
+mod nfa;
mod regression;
-#[cfg(feature = "std")]
-mod suite;
-#[cfg(feature = "std")]
-mod unescape;
+mod util;
+
+type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>;
+
+fn suite() -> Result<RegexTests> {
+ let mut tests = RegexTests::new();
+ macro_rules! load {
+ ($name:expr) => {{
+ const DATA: &[u8] =
+ include_bytes!(concat!("data/", $name, ".toml"));
+ tests.load_slice($name, DATA)?;
+ }};
+ }
+
+ load!("bytes");
+ load!("crazy");
+ load!("earliest");
+ load!("empty");
+ load!("expensive");
+ load!("flags");
+ load!("iter");
+ load!("misc");
+ load!("multiline");
+ load!("no-unicode");
+ load!("overlapping");
+ load!("regression");
+ load!("set");
+ load!("unicode");
+ load!("word-boundary");
+ load!("fowler/basic");
+ load!("fowler/nullsubexpr");
+ load!("fowler/repetition");
+ load!("fowler/repetition-expensive");
+
+ Ok(tests)
+}