about summary refs log tree commit diff
path: root/users/grfn/achilles/src/parser/macros.rs
diff options
context:
space:
mode:
Diffstat (limited to 'users/grfn/achilles/src/parser/macros.rs')
-rw-r--r--users/grfn/achilles/src/parser/macros.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/users/grfn/achilles/src/parser/macros.rs b/users/grfn/achilles/src/parser/macros.rs
new file mode 100644
index 000000000000..406e5c0e699e
--- /dev/null
+++ b/users/grfn/achilles/src/parser/macros.rs
@@ -0,0 +1,16 @@
+#[cfg(test)]
+#[macro_use]
+macro_rules! test_parse {
+    ($parser: ident, $src: expr) => {{
+        let res = $parser($src);
+        nom_trace::print_trace!();
+        let (rem, res) = res.unwrap();
+        assert!(
+            rem.is_empty(),
+            "non-empty remainder: \"{}\", parsed: {:?}",
+            rem,
+            res
+        );
+        res
+    }};
+}