Skip to content

Commit

Permalink
add test_index_negative
Browse files Browse the repository at this point in the history
  • Loading branch information
jfolz committed Nov 15, 2024
1 parent 765c558 commit b2a6949
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/test_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,10 @@ def test_index_slice():
pp = p[start:stop:step]
for i, x in enumerate(pp):
assert pp.index(x) == i, (i, x, start, stop, step)


def test_index_negative():
domain = 18
p = permutation(domain)
with pytest.raises(OverflowError, match="can't convert negative value"):
p.index(-1)

0 comments on commit b2a6949

Please sign in to comment.