about summary refs log tree commit diff
path: root/users/aspen/achilles/src/parser/macros.rs
diff options
context:
space:
mode:
Diffstat (limited to 'users/aspen/achilles/src/parser/macros.rs')
-rw-r--r--users/aspen/achilles/src/parser/macros.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/users/aspen/achilles/src/parser/macros.rs b/users/aspen/achilles/src/parser/macros.rs
new file mode 100644
index 000000000000..406e5c0e699e
--- /dev/null
+++ b/users/aspen/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
+    }};
+}