Add more tests

Need to use box patterns
This commit is contained in:
greg 2016-01-16 16:22:00 -08:00
parent 252b6e8bd9
commit 087402ece6
2 changed files with 4 additions and 1 deletions

View File

@ -1,4 +1,4 @@
#![feature(advanced_slice_patterns, slice_patterns)] #![feature(advanced_slice_patterns, slice_patterns, box_attributes, box_patterns)]
extern crate simplerepl; extern crate simplerepl;

View File

@ -291,6 +291,9 @@ mod tests {
#[test] #[test]
fn parse_test() { fn parse_test() {
parsetest!("a", [ASTNode::ExprNode(Expression::Variable(ref s))], s == "a"); parsetest!("a", [ASTNode::ExprNode(Expression::Variable(ref s))], s == "a");
parsetest!("a + b",
[ASTNode::ExprNode(Expression::BinExp(ref plus, box Expression::Variable(ref a), box Expression::Variable(ref b)))],
plus == "+" && a == "a" && b == "b");
} }
} }