Add paren test

This commit is contained in:
greg 2015-08-07 00:39:02 -07:00
parent b856023072
commit be8c8b3343

View File

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