Skip to content

Commit

Permalink
Better testing for branches on L1103 and L1396 of modulargcd.py
Browse files Browse the repository at this point in the history
Maybe it worth setting random.seed() instead, but I can't
figure yet how to play nicely with caching.
  • Loading branch information
skirpichev committed Dec 5, 2018
1 parent a80488c commit 97527e5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions diofant/polys/tests/test_modulargcd.py
Expand Up @@ -328,6 +328,14 @@ def test_modgcd_algebraic_field():
assert func_field_modgcd(f, g) == (A.one, f, g)


def test_modgcd_algebraic_field_random():
A = QQ.algebraic_field(sqrt(2), sqrt(3))
R, x, y, z = ring("x, y, z", A)
h = x**2*y**3 + 1111*sqrt(6)/12*z
f, g = h*(11*y**3 + 2), h**2*(y + x - 1)
assert func_field_modgcd(f, g) == (h, 11*y**3 + 2, h*(y + x - 1))


# when func_field_modgcd suppors function fields, this test can be changed
def test_modgcd_func_field():
D, t = ring("t", ZZ)
Expand Down

0 comments on commit 97527e5

Please sign in to comment.