Skip to content

Commit e3c9d03

Browse files
committed
modify test for generic poly
1 parent 462318e commit e3c9d03

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/flint/test/test_all.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2664,8 +2664,12 @@ def setbad(obj, i, val):
26642664
assert raises(lambda: P([1, 1]) ** None, TypeError)
26652665

26662666
# XXX: Not sure what this should do in general:
2667-
# TODO: this now fails as fmpz_mod_poly allows modulus
2668-
# assert raises(lambda: pow(P([1, 1]), 2, 3), NotImplementedError)
2667+
p = P([1, 1])
2668+
mod = P([1, 1])
2669+
if type(p) not in [flint.fmpz_mod_poly, flint.nmod_poly]:
2670+
assert raises(lambda: pow(p, 2, mod), NotImplementedError)
2671+
else:
2672+
assert p * p % mod == pow(p, 2, mod)
26692673

26702674
assert P([1, 2, 1]).gcd(P([1, 1])) == P([1, 1])
26712675
assert raises(lambda: P([1, 2, 1]).gcd(None), TypeError)

0 commit comments

Comments
 (0)