From 7e4ca53024b36c2e0099e326c41413ccdfa90887 Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Sat, 26 Oct 2024 13:01:56 +0200 Subject: [PATCH] Added tests --- test/test_init.py | 5 +++++ test/{tests.py => test_instructions.py} | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 test/test_init.py rename test/{tests.py => test_instructions.py} (97%) diff --git a/test/test_init.py b/test/test_init.py new file mode 100644 index 0000000..13ba86e --- /dev/null +++ b/test/test_init.py @@ -0,0 +1,5 @@ +from infernal_interpreter import __version__ + + +def test_init(): + assert __version__ is not None diff --git a/test/tests.py b/test/test_instructions.py similarity index 97% rename from test/tests.py rename to test/test_instructions.py index ab08038..a8bdb6f 100644 --- a/test/tests.py +++ b/test/test_instructions.py @@ -1,11 +1,10 @@ -import os -import sys -import traceback import logging +import traceback + import pytest +from infernal_interpreter.Emulator import CodeParseException, Emulator from infernal_interpreter.Junk import JunkComparisonException -from infernal_interpreter.Emulator import Emulator, CodeParseException logger = logging.getLogger(__name__) @@ -13,6 +12,7 @@ logger = logging.getLogger(__name__) code_tests = [] + def add_test(name, result, register, code): code_tests.append((name, result, register, code)) @@ -179,7 +179,8 @@ start: movq $100, %rsp # Set stack pointer to a random position. ################################################################################ -@pytest.mark.parametrize("name,result,register,code", code_tests) + +@pytest.mark.parametrize('name,result,register,code', code_tests) def test_execution(name, result, register, code): line_nr = None try: