From 1f24376e2e869f3fbd2cbcef6ecbb5952ba87cad Mon Sep 17 00:00:00 2001
From: Matthias Diener <mdiener@illinois.edu>
Date: Thu, 8 Sep 2022 19:10:21 -0500
Subject: [PATCH] test_maximum_minimum_with_scalars: test unsized scalars

---
 test/test_array.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/test/test_array.py b/test/test_array.py
index ca511352..0bb5b740 100644
--- a/test/test_array.py
+++ b/test/test_array.py
@@ -2054,6 +2054,23 @@ def test_maximum_minimum_with_scalars(ctx_factory):
     result = cl_array.minimum(a_cl, b_cl, queue=cq)
     np.testing.assert_allclose(result.get(), b_np)
 
+    # Test 'untyped' scalars
+    # FIXME: these don't work with unsized ints
+    result = cl_array.minimum(4.0, b_cl, queue=cq)
+    np.testing.assert_allclose(result.get(), b_np)
+    result = cl_array.maximum(4.0, b_cl, queue=cq)
+    np.testing.assert_allclose(result.get(), a_np)
+
+    result = cl_array.minimum(b_cl, 4.0, queue=cq)
+    np.testing.assert_allclose(result.get(), b_np)
+    result = cl_array.maximum(b_cl, 4.0, queue=cq)
+    np.testing.assert_allclose(result.get(), a_np)
+
+    result = cl_array.minimum(-3.0, 4.0, queue=cq)
+    np.testing.assert_allclose(result, b_np)
+    result = cl_array.maximum(-3.0, 4.0, queue=cq)
+    np.testing.assert_allclose(result, a_np)
+
 # }}}
 
 
-- 
GitLab