diff options
author | Alexis Roda <alexis.roda.villalonga@gmail.com> | 2019-08-06 21:59:00 +0200 |
---|---|---|
committer | Juan J. MartÃnez <jjm@usebox.net> | 2019-08-06 20:59:00 +0100 |
commit | 2faf74953a23837e02ad0977f870c94b5f8c37d8 (patch) | |
tree | a4f0b0f0c03a4e0823c06acddf413ada9cc746e5 /tests/test_update_counters.py | |
parent | 5b7817484b8bf1d0b52f9c3f8d5e3a3e8b16be46 (diff) | |
download | z80count-2faf74953a23837e02ad0977f870c94b5f8c37d8.tar.gz z80count-2faf74953a23837e02ad0977f870c94b5f8c37d8.zip |
Improved comment alignment (#13)
Diffstat (limited to 'tests/test_update_counters.py')
-rw-r--r-- | tests/test_update_counters.py | 22 |
1 files changed, 22 insertions, 0 deletions
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 |