From 74284d4d98969f21b071612fe8de6b531b7da3b0 Mon Sep 17 00:00:00 2001 From: fdai7763 Date: Tue, 23 Jan 2024 20:32:24 +0100 Subject: [PATCH] added test for is_allowed_string returning false, edited test for is_allowed_string returning true by adding a division --- src/test/py/test_read_math_function.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/py/test_read_math_function.py b/src/test/py/test_read_math_function.py index f8e8bf2..cb2754d 100644 --- a/src/test/py/test_read_math_function.py +++ b/src/test/py/test_read_math_function.py @@ -12,7 +12,9 @@ class read_function(unittest.TestCase): def test_constant_isstring_false(self): self.assertEqual(is_string(42), False) def test_constant_isallowed_string_true(self): - self.assertEqual(is_allowed_string("c", "42^(2)+1-3*4"), True) + self.assertEqual(is_allowed_string("c", "42^(2)+1-3*4/3"), True) + def test_constant_isallowed_string_false(self): + self.assertEqual(is_allowed_string("c", "42^(2)+1-3*4/3x"), False) if __name__ == '__main__': unittest.main()