diff --git a/src/main/py/read_math_function.py b/src/main/py/read_math_function.py index b42196d..3b6238b 100644 --- a/src/main/py/read_math_function.py +++ b/src/main/py/read_math_function.py @@ -1,2 +1,4 @@ def read_constant(type, value): + if type != "c": + value = False return value \ No newline at end of file diff --git a/src/test/py/test_read_math_function.py b/src/test/py/test_read_math_function.py index b17343d..3ee918b 100644 --- a/src/test/py/test_read_math_function.py +++ b/src/test/py/test_read_math_function.py @@ -5,6 +5,8 @@ from src.main.py.read_math_function import * class read_function(unittest.TestCase): def test_constant_without_calculation(self): self.assertEqual(read_constant("c", 42), 42) + def test_constant_no_c(self): + self.assertEqual(read_constant("e", "42*e^x"), False) if __name__ == '__main__': unittest.main()