From 087402ece6aaa1bd9bdeee59b3794616f57a1a78 Mon Sep 17 00:00:00 2001 From: greg Date: Sat, 16 Jan 2016 16:22:00 -0800 Subject: [PATCH] Add more tests Need to use box patterns --- src/main.rs | 2 +- src/parser.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index d56679c..3a99a90 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -#![feature(advanced_slice_patterns, slice_patterns)] +#![feature(advanced_slice_patterns, slice_patterns, box_attributes, box_patterns)] extern crate simplerepl; diff --git a/src/parser.rs b/src/parser.rs index 09a4fdb..6927d15 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -291,6 +291,9 @@ mod tests { #[test] fn parse_test() { 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"); } }