Add test for byte string slicing.

This commit is contained in:
Paul Sokolovsky 2014-01-03 23:38:16 +02:00
parent decad08ef5
commit 26534cec85
1 changed files with 27 additions and 0 deletions

View File

@ -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]