Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
57aebe17
Commit
57aebe17
authored
Jan 28, 2015
by
Paul Sokolovsky
Browse files
tests: Add testcase for bytes() on values in range 128-255.
parent
bbd9251b
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/basics/bytes.py
View file @
57aebe17
...
...
@@ -37,3 +37,9 @@ print(bytes(range(5)))
x
=
b
"
\xff\x8e\xfe
}
\xfd\x7f
"
print
(
len
(
x
))
print
(
x
[
0
],
x
[
1
],
x
[
2
],
x
[
3
])
# Make sure init values are not mistreated as unicode chars
# For sequence of known len
print
(
bytes
([
128
,
255
]))
# For sequence of unknown len
print
(
bytes
(
iter
([
128
,
255
])))
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment