Skip to content

Commit

Permalink
Add regression test for gh-22845
Browse files Browse the repository at this point in the history
  • Loading branch information
Developer-Ecosystem-Engineering committed Dec 21, 2022
1 parent f2fa2e5 commit b0919fe
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions numpy/core/tests/test_regression.py
Expand Up @@ -2553,3 +2553,14 @@ def get_idx(string, str_lst):
f"Unexpected types order of ufunc in {operation}"
f"for {order}. Possible fix: Use signed before unsigned"
"in generate_umath.py")

def test_nonbool_logical(self):
# gh-22845
# create two arrays with bit patterns that do not overlap.
# needs to be large enough to test both SIMD and scalar paths
size = 100
a = np.frombuffer(b'\x01' * size, dtype=np.bool_)
b = np.frombuffer(b'\x80' * size, dtype=np.bool_)
expected = np.ones(size, dtype=np.bool_)
assert_array_equal(np.logical_and(a, b), expected)

0 comments on commit b0919fe

Please sign in to comment.