Skip to content

Commit a745ec6

Browse files
committed
Added tests to proth_number.py
1 parent 33266f2 commit a745ec6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

maths/special_numbers/proth_number.py

+10
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ def proth(number: int) -> int:
5959
return proth_list[number - 1]
6060

6161

62+
def test_proth_valid() -> None:
63+
"""Test the 6 first Proth numbers."""
64+
assert proth(1) == 3, "The 1st Proth number should be 3"
65+
assert proth(2) == 5, "The 2nd Proth number should be 5"
66+
assert proth(3) == 9, "The 3rd Proth number should be 9"
67+
assert proth(4) == 13, "The 4th Proth number should be 13"
68+
assert proth(5) == 17, "The 5th Proth number should be 17"
69+
assert proth(6) == 25, "The 6th Proth number should be 25"
70+
71+
6272
if __name__ == "__main__":
6373
import doctest
6474

0 commit comments

Comments
 (0)