From 72bc3a2fa7aebe0b1f2b5858723b4df9454c5297 Mon Sep 17 00:00:00 2001 From: fdai7783 Date: Sun, 4 Feb 2024 13:21:35 +0100 Subject: [PATCH] Added another testcase --- src/main/py/logical_operations.py | 2 +- src/test/py/test_logical_operations.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/py/logical_operations.py b/src/main/py/logical_operations.py index 179714b..3b519aa 100644 --- a/src/main/py/logical_operations.py +++ b/src/main/py/logical_operations.py @@ -6,7 +6,7 @@ def identity_disconjunctive(variable, operator, zero): def identity_conjunctive(variable, operator, zero): - if zero == 0 and operator == "+": + if zero == 1 and operator == ".": return variable else: return None diff --git a/src/test/py/test_logical_operations.py b/src/test/py/test_logical_operations.py index 364d887..b52791d 100644 --- a/src/test/py/test_logical_operations.py +++ b/src/test/py/test_logical_operations.py @@ -27,6 +27,9 @@ class calculationsWithRoots(unittest.TestCase): def test_conjunctive_identity_1_and_0_equals_None(self): self.assertEqual(identity_conjunctive(1, ".", 0), None) + def test_conjunctive_identity_1_and_0_equals_None(self): + self.assertEqual(identity_conjunctive(0, ".", 1), 0) + if __name__ == "__main__": unittest.main()