AST: Added some tests to ensure operator precedence is handled properly

This commit is contained in:
Daniel Marjamäki 2012-12-16 11:56:23 +01:00
parent bca7927913
commit 8e1e894dff
1 changed files with 6 additions and 0 deletions

View File

@ -7650,6 +7650,12 @@ private:
ASSERT_EQUALS("123*+", testAst("1+2*3"));
ASSERT_EQUALS("12*34*+", testAst("1*2+3*4"));
ASSERT_EQUALS("12*34*5*+", testAst("1*2+3*4*5"));
// Various tests of precedence
ASSERT_EQUALS("ab::c+", testAst("a::b+c"));
ASSERT_EQUALS("abc+=", testAst("a=b+c"));
ASSERT_EQUALS("abc=,", testAst("a,b=c"));
}
void astpar() { // parentheses