From da61dea1b2ca886b3de07e309efde2a78ac5682a Mon Sep 17 00:00:00 2001 From: chenyu Date: Sat, 3 Aug 2024 14:27:23 -0400 Subject: [PATCH] simple failed UOp sub symbolic test case (#5894) --- test/unit/test_symbolic.py | 4 ++++ test/unit/test_uop_symbolic.py | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/test/unit/test_symbolic.py b/test/unit/test_symbolic.py index f2fa0717..91ec9cd1 100644 --- a/test/unit/test_symbolic.py +++ b/test/unit/test_symbolic.py @@ -97,6 +97,10 @@ class TestSymbolic(unittest.TestCase): def test_sub_num_1(self): self.helper_test_variable(Variable("a", 0, 8)-NumNode(1), -1, 7, "(-1+a)") + def test_sub_self(self): + a = Variable("a", 0, 8) + self.helper_test_variable(a*3-a, 0, 16, "(a*2)") + def test_mul_0(self): self.helper_test_variable(Variable("a", 0, 8)*0, 0, 0, "0") diff --git a/test/unit/test_uop_symbolic.py b/test/unit/test_uop_symbolic.py index 83ede267..bdd54eee 100644 --- a/test/unit/test_uop_symbolic.py +++ b/test/unit/test_uop_symbolic.py @@ -152,6 +152,11 @@ class TestSymbolic(unittest.TestCase): def test_sub_num_1(self): self.helper_test_variable(Variable("a", 0, 8)-NumNode(1), -1, 7, {"(-1+a)", "(a+(-1))"}) + @unittest.expectedFailure + def test_sub_self(self): + a = Variable("a", 0, 8) + self.helper_test_variable(a*3-a, 0, 16, "(a*2)") + def test_mul_0(self): self.helper_test_variable(Variable("a", 0, 8)*0, 0, 0, "0")