source/projects/damm/test/test_damm.py

18 lines
356 B
Python
Raw Normal View History

2021-08-04 02:03:16 +00:00
from damm import Damm
import pytest
2021-09-03 04:10:35 +00:00
@pytest.mark.parametrize(
"num",
[
"0", # 0 itself is the start Damm state
"37", # [0, 3] => 7
"92", # [0, 9] => 2
"1234", # Amusingly, this is a 0-product.
],
)
2021-08-04 02:03:16 +00:00
def test_num_verifies(num):
"""Assert that known-good Damm checks pass."""
assert Damm.verify(num)