Add test for byte string slicing.
This commit is contained in:
parent
decad08ef5
commit
26534cec85
|
@ -0,0 +1,27 @@
|
|||
b"123"[0:1]
|
||||
|
||||
b"123"[0:2]
|
||||
|
||||
b"123"[:1]
|
||||
|
||||
b"123"[1:]
|
||||
|
||||
# Idiom for copying sequence
|
||||
b"123"[:]
|
||||
|
||||
b"123"[:-1]
|
||||
|
||||
# Weird cases
|
||||
b"123"[0:0]
|
||||
b"123"[1:0]
|
||||
b"123"[1:1]
|
||||
b"123"[-1:-1]
|
||||
b"123"[-3:]
|
||||
b"123"[-3:3]
|
||||
b"123"[0:]
|
||||
b"123"[:0]
|
||||
b"123"[:-3]
|
||||
b"123"[:-4]
|
||||
# No IndexError!
|
||||
b""[1:1]
|
||||
b""[-1:-1]
|
Loading…
Reference in New Issue