def testPrefixMinusHighPrecedence(self): query = "-5 + 5" expected = expression.Sum( expression.Product(expression.Literal(-1), expression.Literal(5)), expression.Literal(5)) self.assertQueryMatches(query, expected)
def testParens(self): query = "(3 + 2) * 5" expected = expression.Product( expression.Sum(expression.Literal(3), expression.Literal(2)), expression.Literal(5)) self.assertQueryMatches(query, expected)
def testPrefixMinus(self): query = "-(5 + 5)" expected = expression.Product( expression.Literal(-1), expression.Sum(expression.Literal(5), expression.Literal(5))) self.assertQueryMatches(query, expected)