diff options
Diffstat (limited to 'src/parse/tokens.rs')
| -rw-r--r-- | src/parse/tokens.rs | 16 |
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. |
