Add binop parsing test

This commit is contained in:
greg 2016-01-16 16:26:52 -08:00
parent 9b54256521
commit e099f713ad
1 changed files with 6 additions and 2 deletions

View File

@ -296,7 +296,11 @@ mod tests {
parsetest!("a + b",
[ExprNode(BinExp(ref plus, box Variable(ref a), box Variable(ref b)))],
plus == "+" && a == "a" && b == "b");
parsetest!("a + b * c",
[ExprNode(BinExp(ref plus, box Variable(ref a), box BinExp(ref mul, box Variable(ref b), box Variable(ref c))))],
plus == "+" && mul == "*" && a == "a" && b == "b" && c == "c");
parsetest!("a * b + c",
[ExprNode(BinExp(ref plus, box BinExp(ref mul, box Variable(ref a), box Variable(ref b)), box Variable(ref c)))],
plus == "+" && mul == "*" && a == "a" && b == "b" && c == "c");
}
}