Skip to content

Commit

Permalink
Use nonzero data in tests of Issue numba#3158
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarkall committed Jan 25, 2023
1 parent 45fb8e6 commit 2cdfc9a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions numba/tests/test_record_dtype.py
Expand Up @@ -1766,13 +1766,16 @@ def test_issue_1469_3(self):
def test_issue_3158_1(self):
# A nested array dtype.
item = np.dtype([('some_field', np.int32)])
items = np.dtype([('items', item, 10)])
items = np.dtype([('items', item, 3)])

@njit
def fn(x):
return x[0]

arr = np.zeros((2,), items)
arr = np.asarray([([(0,), (1,), (2,)],),
([(4,), (5,), (6,)],)],
dtype=items)

expected = fn.py_func(arr)
actual = fn(arr)

Expand All @@ -1788,7 +1791,9 @@ def test_issue_3158_2(self):
def fn(arr):
return arr[0]

arr = np.zeros(2, dtype3)
arr = np.asarray([(False, [[(0, 1), (2, 3)], [(4, 5), (6, 7)]]),
(True, [[(8, 9), (10, 11)], [(12, 13), (14, 15)]])],
dtype=dtype3)
expected = fn.py_func(arr)
actual = fn(arr)

Expand Down

0 comments on commit 2cdfc9a

Please sign in to comment.