one more test case for symbolic mod mul (#5615)

This commit is contained in:
chenyu
2024-07-20 17:23:06 -04:00
committed by GitHub
parent d71308ed68
commit 92e7e65712
2 changed files with 9 additions and 3 deletions

View File

@@ -160,7 +160,10 @@ class TestSymbolic(unittest.TestCase):
self.helper_test_variable(create_lt_node(Node.sum([Variable("a", 0, 7) * 4, Variable("b", 0, 4)]), 16), 0, 1, "(((a*4)+b)<16)")
self.helper_test_variable(create_lt_node(Node.sum([Variable("uidx", 0, 3), Variable("a", 0, 1529) * 12]), (4 * 67)), 0, 1, "(a<23)")
def test_mod_mul(self):
def test_mod_mul_large(self):
self.helper_test_variable((Variable("a", 0, 20)*10)%9, 0, 8, "(a%9)")
def test_mod_mul_small(self):
self.helper_test_variable((Variable("a", 0, 5)*10)%9, 0, 5, "a")
def test_mod_mod(self):

View File

@@ -226,7 +226,11 @@ class TestSymbolic(unittest.TestCase):
self.helper_test_variable(create_lt_node(Node.sum([Variable("uidx", 0, 3), Variable("a", 0, 1529) * 12]), (4 * 67)), 0, 1, "(a<23)")
@unittest.expectedFailure
def test_mod_mul(self):
def test_mod_mul_large(self):
self.helper_test_variable((Variable("a", 0, 20)*10)%9, 0, 8, "(a%9)")
@unittest.expectedFailure
def test_mod_mul_small(self):
self.helper_test_variable((Variable("a", 0, 5)*10)%9, 0, 5, "a")
@unittest.expectedFailure
@@ -305,7 +309,6 @@ class TestSymbolic(unittest.TestCase):
def test_div_factor(self):
self.helper_test_variable(Node.sum([NumNode(-40), Variable("a", 0, 10)*2, Variable("b", 0, 10)*40]) // 40, -1, 9, "(-1+b)")
# TODO: this one should already work!
def test_mul_div(self):
self.helper_test_variable((Variable("a", 0, 10)*4)//4, 0, 10, "a")