diff --git a/test/test_access.py b/test/test_access.py index 15c3d20..3ca5217 100644 --- a/test/test_access.py +++ b/test/test_access.py @@ -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)