You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
Add test for byte string slicing.
This commit is contained in:
@@ -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]
|
||||
Reference in New Issue
Block a user