errortype tests
@@ -23,6 +23,13 @@ class TestRational(unittest.TestCase):
with pytest.raises(TypeError):
cupy.gcd(a, b)
+ @testing.for_int_dtypes(no_bool=True)
+ @testing.numpy_cupy_array_equal()
+ def test_gcd_erroneous_cases(self, xp, dtype):
+ a = xp.array([0, -10, -5, 10])
+ b = xp.array([0, 5, -10, -5])
+ return xp.gcd(a, b)
+
@testing.for_int_dtypes(no_bool=True)
@testing.numpy_cupy_array_equal()
def test_lcm_basic(self, xp, dtype):
@@ -36,3 +43,10 @@ class TestRational(unittest.TestCase):
b = cupy.random.randint(-10, 10, size=(10, 10)).astype(dtype)
with pytest.raises(TypeError):
cupy.lcm(a, b)
+
+ @testing.for_int_dtypes(no_bool=True)
+ @testing.numpy_cupy_array_equal()
+ def test_lcm_erroneous_cases(self, xp, dtype):
+ a = xp.array([0, -10, -5, 10])
+ b = xp.array([0, 5, -10, -5])
+ return xp.lcm(a, b)
