From 2b12ad0f788d93a210ea60efdcb7d7330907683c Mon Sep 17 00:00:00 2001 From: jazzthief Date: Thu, 19 Jan 2023 18:05:56 +0100 Subject: [PATCH] Add precedence test for NOT --- test/sql/test_operators.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/sql/test_operators.py b/test/sql/test_operators.py index 3424f3ab3f..b426aba8a4 100644 --- a/test/sql/test_operators.py +++ b/test/sql/test_operators.py @@ -1768,6 +1768,15 @@ class OperatorPrecedenceTest(fixtures.TestBase, testing.AssertsCompiledSQL): self.assert_compile(op2, "mytable.myid hoho :myid_1 lala :param_1") self.assert_compile(op3, "(mytable.myid hoho :myid_1) lala :param_1") + def test_bitwise_not_precedence(self): + op1 = operators.bitwise_not_op + c = self.table1.c.myid + op2 = op1(c).op("lala", precedence=6)(4) + op3 = op1(c).op("lala", precedence=8)(4) + + self.assert_compile(op2, "~mytable.myid lala :param_1") + self.assert_compile(op3, "(~mytable.myid) lala :param_1") + @testing.combinations( ("xor", operators.bitwise_xor_op, "^"), ("or", operators.bitwise_or_op, "|"), -- 2.47.3