Skip to content

Commit 9114aed

Browse files
committed
test_numbertheory: next_prime additional coverage
the regular tests don't verify the behaviour for small/negative numbers, check that too
1 parent 47427a7 commit 9114aed

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ecdsa/test_numbertheory.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ def test_next_prime(prime, next_p):
4949
assert next_prime(prime) == next_p
5050

5151

52+
@pytest.mark.parametrize(
53+
"val",
54+
[-1, 0, 1])
55+
def test_next_prime_with_nums_less_2(val):
56+
assert next_prime(val) == 2
57+
58+
5259
@pytest.mark.parametrize("prime", smallprimes)
5360
def test_square_root_mod_prime_for_small_primes(prime):
5461
squares = set()

0 commit comments

Comments
 (0)