From 347adff7cd763637943857b25441814a71effdd8 Mon Sep 17 00:00:00 2001 From: Silas Kraume Date: Wed, 4 Oct 2023 00:36:06 +0200 Subject: [PATCH] added eval tests --- cat_win/tests/test_converter.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cat_win/tests/test_converter.py b/cat_win/tests/test_converter.py index df706888..f84f18a4 100644 --- a/cat_win/tests/test_converter.py +++ b/cat_win/tests/test_converter.py @@ -91,6 +91,14 @@ def test_wrong_input(self): self.assertEqual(converter.is_bin('2'), expected_output) self.assertEqual(converter.is_bin('0x1'), expected_output) + def test_evaluate_integrated(self): + self.assertEqual(converter.evaluate('test11**2test', True), 'test121test') + self.assertEqual(converter.evaluate('test(5/(3-0x3))test', True), 'test???test') + + def test_evaluate_not_integrated(self): + self.assertEqual(converter.evaluate('test11**2test', False), '121') + self.assertEqual(converter.evaluate('test(5/(3-0x3))test', False), '???') + def test_exception_handler(self): exc = ZeroDivisionError() group = '1/0'