tests/basics: Split out specific slice tests to separate files.
So they can be automatically skipped if slice is not enabled.
This commit is contained in:
parent
ecb77e40e0
commit
b5186c9271
@ -19,10 +19,6 @@ print(x)
|
|||||||
x += [2, 1]
|
x += [2, 1]
|
||||||
print(x)
|
print(x)
|
||||||
|
|
||||||
print(x[1:])
|
|
||||||
print(x[:-1])
|
|
||||||
print(x[2:3])
|
|
||||||
|
|
||||||
# unsupported type on RHS of add
|
# unsupported type on RHS of add
|
||||||
try:
|
try:
|
||||||
[] + None
|
[] + None
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
# test list slices, getting values
|
# test list slices, getting values
|
||||||
|
|
||||||
x = list(range(10))
|
x = list(range(10))
|
||||||
|
|
||||||
|
print(x[1:])
|
||||||
|
print(x[:-1])
|
||||||
|
print(x[2:3])
|
||||||
|
|
||||||
a = 2
|
a = 2
|
||||||
b = 4
|
b = 4
|
||||||
c = 3
|
c = 3
|
||||||
|
@ -11,10 +11,6 @@ try:
|
|||||||
except AttributeError:
|
except AttributeError:
|
||||||
print("AttributeError")
|
print("AttributeError")
|
||||||
|
|
||||||
print(x[1:])
|
|
||||||
print(x[:-1])
|
|
||||||
print(x[2:3])
|
|
||||||
|
|
||||||
print(x + (10, 100, 10000))
|
print(x + (10, 100, 10000))
|
||||||
|
|
||||||
# inplace add operator
|
# inplace add operator
|
||||||
|
7
tests/basics/tuple_slice.py
Normal file
7
tests/basics/tuple_slice.py
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# tuple slicing
|
||||||
|
|
||||||
|
x = (1, 2, 3 * 4)
|
||||||
|
|
||||||
|
print(x[1:])
|
||||||
|
print(x[:-1])
|
||||||
|
print(x[2:3])
|
Loading…
x
Reference in New Issue
Block a user