Add paren test
This commit is contained in:
parent
b856023072
commit
be8c8b3343
@ -280,5 +280,11 @@ mod tests {
|
|||||||
assert_eq!(format!("{:?}", ast), "Statements([BinOp(Name(\"+\"), Name(\"a\"), BinOp(Name(\"*\"), Name(\"b\"), Name(\"c\")))])"),
|
assert_eq!(format!("{:?}", ast), "Statements([BinOp(Name(\"+\"), Name(\"a\"), BinOp(Name(\"*\"), Name(\"b\"), Name(\"c\")))])"),
|
||||||
ParseResult::Err(err) => panic!("err: {:?}", err)
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user