From ac0efecc5558687b1215264896b436b33353c7ec Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Mon, 29 Apr 2024 22:38:21 +0300 Subject: Make @include idempotent --- test/e2e/include_idempotency/p1.atk16 | 4 ++++ test/e2e/include_idempotency/p2.atk16 | 6 ++++++ test/e2e/include_idempotency/test_include_idempotent.py | 14 ++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 test/e2e/include_idempotency/p1.atk16 create mode 100644 test/e2e/include_idempotency/p2.atk16 create mode 100644 test/e2e/include_idempotency/test_include_idempotent.py (limited to 'test/e2e') diff --git a/test/e2e/include_idempotency/p1.atk16 b/test/e2e/include_idempotency/p1.atk16 new file mode 100644 index 0000000..f9f6363 --- /dev/null +++ b/test/e2e/include_idempotency/p1.atk16 @@ -0,0 +1,4 @@ +@include %bootstrap + +@label main + hlt diff --git a/test/e2e/include_idempotency/p2.atk16 b/test/e2e/include_idempotency/p2.atk16 new file mode 100644 index 0000000..c6d46b9 --- /dev/null +++ b/test/e2e/include_idempotency/p2.atk16 @@ -0,0 +1,6 @@ +@include %bootstrap +@include %bootstrap +@include %bootstrap + +@label main + hlt diff --git a/test/e2e/include_idempotency/test_include_idempotent.py b/test/e2e/include_idempotency/test_include_idempotent.py new file mode 100644 index 0000000..e7b4fc8 --- /dev/null +++ b/test/e2e/include_idempotency/test_include_idempotent.py @@ -0,0 +1,14 @@ +import os.path +from test.utils import assemble_and_run_until_halted + +def test_include_idempotent(): + machine1 = assemble_and_run_until_halted( + os.path.join(os.path.dirname(__file__), "p1.atk16") + ) + + machine2 = assemble_and_run_until_halted( + os.path.join(os.path.dirname(__file__), "p2.atk16") + ) + + for i in range(len(machine1.rom.memory)): + assert machine1.rom.memory[i] == machine2.rom.memory[i] -- cgit v1.3