From e1b0f2a16fc03fe5127e74626a249d8f395d8d58 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 17 May 2017 16:33:57 +1000 Subject: [PATCH] tests/basics/list_slice_3arg: Add more tests for negative slicing. --- tests/basics/list_slice_3arg.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/basics/list_slice_3arg.py b/tests/basics/list_slice_3arg.py index 8578d5855e..a5eda8034d 100644 --- a/tests/basics/list_slice_3arg.py +++ b/tests/basics/list_slice_3arg.py @@ -26,3 +26,14 @@ print(x[-1:-1:-1]) print(x[-1:-2:-1]) print(x[-1:-11:-1]) print(x[-10:-11:-1]) +print(x[:-15:-1]) + +# test negative indices that are out-of-bounds +print([][::-1]) +print([1][::-1]) +print([][0:-10:-1]) +print([1][0:-10:-1]) +print([][:-20:-1]) +print([1][:-20:-1]) +print([][-20::-1]) +print([1][-20::-1])