From 685034ad8d1f69d59aa3a4452d48bdc85c8fff58 Mon Sep 17 00:00:00 2001 From: SwayamInSync Date: Mon, 13 Apr 2026 11:00:31 +0000 Subject: [PATCH] adding arr.cong test --- tests/test_quaddtype.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_quaddtype.py b/tests/test_quaddtype.py index 80cef20..0850e4b 100644 --- a/tests/test_quaddtype.py +++ b/tests/test_quaddtype.py @@ -3544,6 +3544,17 @@ def test_conj_conjugate_identity(func, value): assert result == x +def test_array_conjugate_method(): + """Test that .conj() works on quaddtype arrays (goes through PyArray_Conjugate). + + Regression test for https://github.com/numpy/numpy/pull/31193 + """ + arr = np.array([1.5, -2.5, 0.0], dtype=QuadPrecDType()) + result = arr.conj() + assert result.dtype == arr.dtype + np.testing.assert_array_equal(result.astype(float), [1.5, -2.5, 0.0]) + + @pytest.mark.parametrize("x1,x2,expected", [ # Basic Pythagorean triples (3.0, 4.0, 5.0),