Skip to content

Commit 391af92

Browse files
committed
add an explicit test that embedded and trailing nulls are stored properly
1 parent 39be9fe commit 391af92

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

stringdtype/tests/test_stringdtype.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,3 +717,10 @@ def test_datetime_cast(dtype):
717717
a = np.delete(a, 3)
718718

719719
np.testing.assert_array_equal(sa, a.astype("U"))
720+
721+
722+
def test_null_roundtripping(dtype):
723+
data = ["hello\0world", "ABC\0DEF\0\0"]
724+
arr = np.array(data, dtype=dtype)
725+
assert data[0] == arr[0]
726+
assert data[1] == arr[1]

0 commit comments

Comments
 (0)