diff --git a/scripts/run_tests.py b/scripts/run_tests.py index 2f941400..f436c8fb 100644 --- a/scripts/run_tests.py +++ b/scripts/run_tests.py @@ -62,7 +62,7 @@ else: if sys.platform in ['linux', 'darwin']: cmd = './main' elif sys.platform == 'win32': - cmd = 'main.exe' + cmd = '.\main.exe' else: cmd = None @@ -80,9 +80,8 @@ else: print(add(1, 2)) - print(A('abc').get()) - ''', capture_output=True, check=True) + print(A('abc').get())''', capture_output=True, check=True) res.check_returncode() - assert res.stdout.endswith('>>> 3\n>>> abc\n>>> ') + assert res.stdout.endswith('>>> 3\n>>> abc\n>>> '), res.stdout -print("ALL TESTS PASSED") \ No newline at end of file +print("ALL TESTS PASSED") diff --git a/tests/01_int.py b/tests/01_int.py index fd077509..995f9522 100644 --- a/tests/01_int.py +++ b/tests/01_int.py @@ -115,3 +115,5 @@ try: exit(1) except ZeroDivisionError: pass + +assert not 1 < 2 > 3 diff --git a/tests/30_import.py b/tests/30_import.py index ba005c51..a4ca7b3a 100644 --- a/tests/30_import.py +++ b/tests/30_import.py @@ -27,3 +27,6 @@ def f(): assert value == 1 f() + +from math import * +assert pi > 3 diff --git a/tests/41_exception.py b/tests/41_exception.py index 0e1fff50..d1e69008 100644 --- a/tests/41_exception.py +++ b/tests/41_exception.py @@ -1,3 +1,14 @@ +try: + raise 1 +except TypeError: + pass + +try: + assert False + exit(1) +except AssertionError: + pass + try: for i in range(5): raise KeyError(i) diff --git a/tests/99_builtin_func.py b/tests/99_builtin_func.py index 895d6dc3..7dfe646c 100644 --- a/tests/99_builtin_func.py +++ b/tests/99_builtin_func.py @@ -674,3 +674,11 @@ assert issubclass(object, object) is True assert issubclass(int, type) is False assert issubclass(type, type) is True assert issubclass(float, int) is False + + +def f(a, b): + c = a + del a + return sum([b, c]) + +assert f(1, 2) == 3