mirror of
https://github.com/python/cpython.git
synced 2025-07-22 10:45:22 +00:00

imports e.g. test_support must do so using an absolute package name such as "import test.test_support" or "from test import test_support". This also updates the README in Lib/test, and gets rid of the duplicate data dirctory in Lib/test/data (replaced by Lib/email/test/data). Now Tim and Jack can have at it. :)
14 lines
629 B
Python
14 lines
629 B
Python
# tests for slice objects; in particular the indices method.
|
|
|
|
from test.test_support import vereq
|
|
|
|
vereq(slice(None ).indices(10), (0, 10, 1))
|
|
vereq(slice(None, None, 2).indices(10), (0, 10, 2))
|
|
vereq(slice(1, None, 2).indices(10), (1, 10, 2))
|
|
vereq(slice(None, None, -1).indices(10), (9, -1, -1))
|
|
vereq(slice(None, None, -2).indices(10), (9, -1, -2))
|
|
vereq(slice(3, None, -2).indices(10), (3, -1, -2))
|
|
vereq(slice(-100, 100 ).indices(10), slice(None).indices(10))
|
|
vereq(slice(100, -100, -1).indices(10), slice(None, None, -1).indices(10))
|
|
vereq(slice(-100L, 100L, 2L).indices(10), (0, 10, 2))
|
|
|