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]
|
||||
print(x)
|
||||
|
||||
print(x[1:])
|
||||
print(x[:-1])
|
||||
print(x[2:3])
|
||||
|
||||
# unsupported type on RHS of add
|
||||
try:
|
||||
[] + None
|
||||
|
@ -1,6 +1,11 @@
|
||||
# test list slices, getting values
|
||||
|
||||
x = list(range(10))
|
||||
|
||||
print(x[1:])
|
||||
print(x[:-1])
|
||||
print(x[2:3])
|
||||
|
||||
a = 2
|
||||
b = 4
|
||||
c = 3
|
||||
|
@ -11,10 +11,6 @@ try:
|
||||
except AttributeError:
|
||||
print("AttributeError")
|
||||
|
||||
print(x[1:])
|
||||
print(x[:-1])
|
||||
print(x[2:3])
|
||||
|
||||
print(x + (10, 100, 10000))
|
||||
|
||||
# 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