micropython: add micropython component
This commit is contained in:
13
components/language/micropython/tests/basics/memoryerror.py
Normal file
13
components/language/micropython/tests/basics/memoryerror.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# test out-of-memory with malloc
|
||||
l = list(range(1000))
|
||||
try:
|
||||
1000000000 * l
|
||||
except MemoryError:
|
||||
print('MemoryError')
|
||||
print(len(l), l[0], l[-1])
|
||||
|
||||
# test out-of-memory with realloc
|
||||
try:
|
||||
[].extend(range(1000000000))
|
||||
except MemoryError:
|
||||
print('MemoryError')
|
Reference in New Issue
Block a user