Skip to content

Commit 72da798

Browse files
committed
TST: add segfaulting test
1 parent c89f955 commit 72da798

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

numpy/_core/tests/test_stringdtype.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,9 +495,23 @@ def test_fancy_indexing(string_list):
495495
sarr = np.array(string_list, dtype="T")
496496
assert_array_equal(sarr, sarr[np.arange(sarr.shape[0])])
497497

498+
inds = [
499+
[True, True],
500+
[0, 1],
501+
...,
502+
np.array([0, 1], dtype='uint8'),
503+
]
504+
505+
lops = [
506+
['a'*25, 'b'*25],
507+
['', ''],
508+
['hello', 'world'],
509+
['hello', 'world'*25],
510+
]
511+
498512
# see gh-27003 and gh-27053
499-
for ind in [[True, True], [0, 1], ..., np.array([0, 1], dtype='uint8')]:
500-
for lop in [['a'*25, 'b'*25], ['', '']]:
513+
for ind in inds:
514+
for lop in lops:
501515
a = np.array(lop, dtype="T")
502516
assert_array_equal(a[ind], a)
503517
rop = ['d'*25, 'e'*25]

0 commit comments

Comments
 (0)