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) + } } }