summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/bytes.py
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-08-11 22:36:38 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-08-11 22:38:00 +0300
commit9749b2fb0d6c4ff65c7395e09028102c9508b34a (patch)
treeb6aaa1bb52bd1ed7516ae4545771f0b797ae8057 /tests/basics/bytes.py
parent6e6bcccdc19f35ccb09c064cb444eb498c307a33 (diff)
downloadmicropython-9749b2fb0d6c4ff65c7395e09028102c9508b34a.tar.gz
micropython-9749b2fb0d6c4ff65c7395e09028102c9508b34a.zip
objstr: Make sure that bytes are indexed as bytes, not as unicode.
Fixes #795.
Diffstat (limited to 'tests/basics/bytes.py')
-rw-r--r--tests/basics/bytes.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/basics/bytes.py b/tests/basics/bytes.py
index a084bc3994..ce027e7d19 100644
--- a/tests/basics/bytes.py
+++ b/tests/basics/bytes.py
@@ -37,3 +37,8 @@ def gen():
for i in range(4):
yield i
print(bytes(gen()))
+
+# Make sure bytes are not mistreated as unicode
+x = b"\xff\x8e\xfe}\xfd\x7f"
+print(len(x))
+print(x[0], x[1], x[2], x[3])