From 2faf74953a23837e02ad0977f870c94b5f8c37d8 Mon Sep 17 00:00:00 2001 From: Alexis Roda Date: Tue, 6 Aug 2019 21:59:00 +0200 Subject: Improved comment alignment (#13) --- tests/test_update_counters.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/test_update_counters.py (limited to 'tests/test_update_counters.py') diff --git a/tests/test_update_counters.py b/tests/test_update_counters.py new file mode 100644 index 0000000..517e165 --- /dev/null +++ b/tests/test_update_counters.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- + +from z80count.z80count import update_counters + + +def _make_entry(states, states_met=0): + return { + "_t_states_met": states_met, + "_t_states_or_not_met": states, + } + + +def test_unconditional_instruction(): + total, total_cond = update_counters(_make_entry(3), 8) + assert total == 11 + assert total_cond == 0 + + +def test_conditional_instruction(): + total, total_cond = update_counters(_make_entry(7, 5), 35) + assert total == 42 + assert total_cond == 40 -- cgit v1.2.3