Skip to content

Commit ce501f5

Browse files
committed
Add empty array test
1 parent 5921690 commit ce501f5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/test_funcs.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,11 @@ def test_fill_value(self, xp: ModuleType) -> None:
995995
xp.asarray([1.0, 2.0, 3.0, 4.0]),
996996
)
997997

998+
def test_empty_array(self, xp: ModuleType) -> None:
999+
a = xp.asarray([], dtype=xp.float32)
1000+
xp_assert_equal(nan_to_num(a, xp=xp), a)
1001+
assert xp.isdtype(nan_to_num(a, xp=xp).dtype, xp.float32)
1002+
9981003

9991004
class TestNUnique:
10001005
def test_simple(self, xp: ModuleType):

0 commit comments

Comments
 (0)