Skip to content

Commit

Permalink
few more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GiacomoPope committed Jul 23, 2024
1 parent e98225c commit 60c1d3d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_polynomial_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_reduce_coefficients(self):
randint(-2 * self.R.q, 3 * self.R.q) for _ in range(self.R.n)
]
f = self.R(coeffs).reduce_coefficients()
self.assertTrue(all([c < self.R.q for c in f.coeffs]))
self.assertTrue(all([0 <= c < self.R.q for c in f.coeffs]))

def test_equality(self):
for _ in range(100):
Expand All @@ -77,6 +77,10 @@ def test_sub_failure(self):
f1 = self.R.random_element()
self.assertRaises(NotImplementedError, lambda: f1 - "a")

def test_mul_failure(self):
f1 = self.R.random_element()
self.assertRaises(NotImplementedError, lambda: f1 * "a")

def test_pow_failure(self):
f1 = self.R.random_element()
self.assertRaises(TypeError, lambda: f1 ** "a")
Expand Down

0 comments on commit 60c1d3d

Please sign in to comment.