From be8c8b33434c747745c96e8d3e5182bddcfcb5be Mon Sep 17 00:00:00 2001 From: greg Date: Fri, 7 Aug 2015 00:39:02 -0700 Subject: [PATCH] Add paren test --- src/parser.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/parser.rs b/src/parser.rs index 1c946a6..6fefb57 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -280,5 +280,11 @@ mod tests { assert_eq!(format!("{:?}", ast), "Statements([BinOp(Name(\"+\"), Name(\"a\"), BinOp(Name(\"*\"), Name(\"b\"), Name(\"c\")))])"), ParseResult::Err(err) => panic!("err: {:?}", err) } + + match parse(tokenize("(a + b) * c")) { + ParseResult::Ok(ast) => + assert_eq!(format!("{:?}", ast), "Statements([BinOp(Name(\"*\"), BinOp(Name(\"+\"), Name(\"a\"), Name(\"b\")), Name(\"c\"))])"), + ParseResult::Err(err) => panic!("err: {:?}", err) + } } }