Unbreak string slice test by just switching to normal (not byte) strings.
This commit is contained in:
parent
21dfb55dad
commit
9464cde3c9
@ -1,32 +0,0 @@
|
|||||||
print(b"123"[0:1])
|
|
||||||
|
|
||||||
print(b"123"[0:2])
|
|
||||||
|
|
||||||
print(b"123"[:1])
|
|
||||||
|
|
||||||
print(b"123"[1:])
|
|
||||||
|
|
||||||
# Idiom for copying sequence
|
|
||||||
print(b"123"[:])
|
|
||||||
|
|
||||||
print(b"123"[:-1])
|
|
||||||
|
|
||||||
# Weird cases
|
|
||||||
print(b"123"[0:0])
|
|
||||||
print(b"123"[1:0])
|
|
||||||
print(b"123"[1:1])
|
|
||||||
print(b"123"[-1:-1])
|
|
||||||
print(b"123"[-3:])
|
|
||||||
print(b"123"[-3:3])
|
|
||||||
print(b"123"[0:])
|
|
||||||
print(b"123"[:0])
|
|
||||||
print(b"123"[:-3])
|
|
||||||
print(b"123"[:-4])
|
|
||||||
# Range check testing, don't segfault, please ;-)
|
|
||||||
print(b"123"[:1000000])
|
|
||||||
print(b"123"[1000000:])
|
|
||||||
print(b"123"[:-1000000])
|
|
||||||
print(b"123"[-1000000:])
|
|
||||||
# No IndexError!
|
|
||||||
print(b""[1:1])
|
|
||||||
print(b""[-1:-1])
|
|
32
tests/basics/tests/string-slice.py
Normal file
32
tests/basics/tests/string-slice.py
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
print("123"[0:1])
|
||||||
|
|
||||||
|
print("123"[0:2])
|
||||||
|
|
||||||
|
print("123"[:1])
|
||||||
|
|
||||||
|
print("123"[1:])
|
||||||
|
|
||||||
|
# Idiom for copying sequence
|
||||||
|
print("123"[:])
|
||||||
|
|
||||||
|
print("123"[:-1])
|
||||||
|
|
||||||
|
# Weird cases
|
||||||
|
print("123"[0:0])
|
||||||
|
print("123"[1:0])
|
||||||
|
print("123"[1:1])
|
||||||
|
print("123"[-1:-1])
|
||||||
|
print("123"[-3:])
|
||||||
|
print("123"[-3:3])
|
||||||
|
print("123"[0:])
|
||||||
|
print("123"[:0])
|
||||||
|
print("123"[:-3])
|
||||||
|
print("123"[:-4])
|
||||||
|
# Range check testing, don't segfault, please ;-)
|
||||||
|
print("123"[:1000000])
|
||||||
|
print("123"[1000000:])
|
||||||
|
print("123"[:-1000000])
|
||||||
|
print("123"[-1000000:])
|
||||||
|
# No IndexError!
|
||||||
|
print(""[1:1])
|
||||||
|
print(""[-1:-1])
|
Loading…
Reference in New Issue
Block a user