summaryrefslogtreecommitdiff
path: root/src/parse/tokens.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-01-16 15:08:03 +0100
committerLaurenz <laurmaedje@gmail.com>2021-01-16 15:08:03 +0100
commit51efb0f4d69943e290d977673970cd3c8ada306f (patch)
tree6478ba698749eec120755e283adf7932a6a98d2f /src/parse/tokens.rs
parentd763f0f5a6a700352ee8926c15c8e58624f705c9 (diff)
Port remaining parser tests 🚚
Diffstat (limited to 'src/parse/tokens.rs')
-rw-r--r--src/parse/tokens.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/parse/tokens.rs b/src/parse/tokens.rs
index 85fc4978..68b31a87 100644
--- a/src/parse/tokens.rs
+++ b/src/parse/tokens.rs
@@ -441,7 +441,6 @@ impl Debug for Tokens<'_> {
#[allow(non_snake_case)]
mod tests {
use super::*;
- use crate::parse::tests::check;
use Option::None;
use Token::{Ident, *};
@@ -539,10 +538,23 @@ mod tests {
let src = $src;
let exp = vec![$($token),*];
let found = Tokens::new(&src, $mode).collect::<Vec<_>>();
- check(&src, exp, found, false);
+ check(&src, exp, found);
}};
}
+ #[track_caller]
+ fn check<T>(src: &str, exp: T, found: T)
+ where
+ T: Debug + PartialEq,
+ {
+ if exp != found {
+ println!("source: {:?}", src);
+ println!("expected: {:#?}", exp);
+ println!("found: {:#?}", found);
+ panic!("test failed");
+ }
+ }
+
#[test]
fn test_tokenize_brackets() {
// Test in markup.