/**
* Boolean precedence respects Java conventions.
*/
public void testBoolPrecedence() throws Exception {
boolean compare = 324.4326 < 259 / 134.6 + 2356;
Expression e = buildExpression("324.4326 < 259 / 134.6 + 2356");
assertEquals("Boolean precedence not evaluated correctly", compare, e.evaluate(null));
compare = 324.4326 < 259 / (134.6 + 2356);
e = buildExpression("324.4326 < 259 / (134.6 + 2356)");
assertEquals("Boolean precedence not evaluated correctly", compare, e.evaluate(null));
e = buildExpression("324.4326 == 259 / (134.6 + 2356) && (false || true)");
assertFalse("Boolean precedence not evaluated correctly", e.evaluate(null));
e = buildExpression("346 > 346 ? 6541 / 21 - 77 : 235.66");
assertEquals("Boolean precedence not evaluated correctly", 235.66, e.evaluate(null));
e = buildExpression("false == false ? 16 : 21");
assertEquals("Boolean precedence not evaluated correctly", 16., e.evaluate(null));
e = buildExpression("false && false ? 16 : 21");
assertEquals("Boolean precedence not evaluated correctly", 21., e.evaluate(null));
e = buildExpression("true ? 16 : 21 < 20");
assertEquals("Boolean precedence not evaluated correctly", 16., e.evaluate(null));
e = buildExpression("! true && false");
assertEquals("Boolean precedence not evaluated correctly", false, e.evaluate(null));
}