Skip to content

Commit 3a399b1

Browse files
committed
Add a test for empty arrays (shape=())
1 parent 4b3e07c commit 3a399b1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/ndarray/test_zeros.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,12 @@ def test_nd_dtype(dtype):
157157
np.testing.assert_equal(a2, b2)
158158
else:
159159
np.testing.assert_equal(a[:], b)
160+
161+
162+
def test_shape_empty():
163+
# Test that the shape is correctly set to () for an empty array
164+
a = blosc2.zeros((), dtype=np.int32)
165+
assert a.shape == ()
166+
assert a.dtype == np.int32
167+
b = np.zeros((), dtype=np.int32)
168+
np.testing.assert_equal(a[()], b)

0 commit comments

Comments
 (0)