From 252b6e8bd9c94994d5eb67b6fa54b3a029b8db85 Mon Sep 17 00:00:00 2001 From: greg Date: Sat, 16 Jan 2016 16:12:58 -0800 Subject: [PATCH] Okay, this strategy makes the test work --- src/parser.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/parser.rs b/src/parser.rs index 4735fb8..09a4fdb 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -276,12 +276,12 @@ mod tests { use super::*; macro_rules! parsetest { - ($input:expr, $output:pat) => { + ($input:expr, $output:pat, $ifexpr:expr) => { { let tokens = tokenizer::tokenize($input).unwrap(); let ast = parse(&tokens, &[]).unwrap(); match &ast[..] { - $output => (), + $output if $ifexpr => (), x => panic!("Error in parse test, got {:?} instead", x) } } @@ -290,7 +290,7 @@ mod tests { #[test] fn parse_test() { - parsetest!("a", [ASTNode::ExprNode(Expression::Variable("a"))]); + parsetest!("a", [ASTNode::ExprNode(Expression::Variable(ref s))], s == "a"); } }