From 1fe453fb67ebfb2e6753e97a6bea7ea62e447b22 Mon Sep 17 00:00:00 2001 From: Lucas Colley Date: Thu, 14 Nov 2024 20:01:38 +0000 Subject: [PATCH] TST: sinc: add 3D test --- tests/test_funcs.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_funcs.py b/tests/test_funcs.py index b37d32b..30e71eb 100644 --- a/tests/test_funcs.py +++ b/tests/test_funcs.py @@ -237,3 +237,9 @@ def test_simple(self): def test_dtype(self, x): with pytest.raises(ValueError, match="real floating data type"): sinc(xp.asarray(x), xp=xp) + + def test_3d(self): + x = xp.reshape(xp.arange(18, dtype=xp.float64), (3, 3, 2)) + expected = xp.zeros((3, 3, 2)) + expected[0, 0, 0] = 1.0 + assert_allclose(sinc(x, xp=xp), expected, atol=1e-15)