Skip to content

Commit b32880b

Browse files
committed
tests/heapalloc_bytesio: Test for BytesIO with preallocates space.
1 parent 50d3a9d commit b32880b

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import uio
2+
import micropython
3+
4+
data = b"1234" * 16
5+
buf = uio.BytesIO(64)
6+
7+
micropython.heap_lock()
8+
9+
buf.write(data)
10+
11+
micropython.heap_unlock()
12+
13+
print(buf.getvalue())
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
b'1234123412341234123412341234123412341234123412341234123412341234'

0 commit comments

Comments
 (0)