Commit 7839b8b8 authored by Damien George's avatar Damien George
Browse files

tests/micropython/heapalloc_iter: Add tests for contains and unpack.

parent e6003f46
......@@ -25,6 +25,22 @@ fs = frozenset((1,))
g1 = (100 + x for x in range(2))
g2 = gen_func()
# test containment (both success and failure) with the heap locked
heap_lock()
print(49 in b'123', 255 in b'123')
print(1 in t, -1 in t)
print(1 in l, -1 in l)
print(1 in d, -1 in d)
print(1 in s, -1 in s)
heap_unlock()
# test unpacking with the heap locked
unp0 = unp1 = unp2 = None # preallocate slots for globals
heap_lock()
unp0, unp1, unp2 = t
print(unp0, unp1, unp2)
heap_unlock()
# test certain builtins with the heap locked
heap_lock()
print(all(t))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment