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