Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Commit e1b0f2a

Browse files
committed
tests/basics/list_slice_3arg: Add more tests for negative slicing.
1 parent eb4c37f commit e1b0f2a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/basics/list_slice_3arg.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,14 @@
2626
print(x[-1:-2:-1])
2727
print(x[-1:-11:-1])
2828
print(x[-10:-11:-1])
29+
print(x[:-15:-1])
30+
31+
# test negative indices that are out-of-bounds
32+
print([][::-1])
33+
print([1][::-1])
34+
print([][0:-10:-1])
35+
print([1][0:-10:-1])
36+
print([][:-20:-1])
37+
print([1][:-20:-1])
38+
print([][-20::-1])
39+
print([1][-20::-1])

0 commit comments

Comments
 (0)