From ae6f85891a0e6e5faebb1d89eef9461af858549b Mon Sep 17 00:00:00 2001 From: mhostetter Date: Thu, 30 Nov 2023 19:21:20 -0500 Subject: [PATCH] Add unit test for bug #528 --- tests/test_primes.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_primes.py b/tests/test_primes.py index 9b9c199e2..fc45b7ced 100644 --- a/tests/test_primes.py +++ b/tests/test_primes.py @@ -58,6 +58,17 @@ def test_next_prime(next_prime): assert galois.next_prime(x) == z +def test_next_prime_bug_528(): + """ + https://github.com/mhostetter/galois/issues/528 + """ + assert galois.next_prime(100000034) == 100000037 + assert galois.next_prime(100000035) == 100000037 + assert galois.next_prime(100000036) == 100000037 + assert galois.next_prime(100000037) == 100000039 + assert galois.next_prime(100000038) == 100000039 + + def test_random_prime_exceptions(): with pytest.raises(TypeError): galois.random_prime(10.0)