diff --git a/tests/micropython/heapalloc_iter.py b/tests/micropython/heapalloc_iter.py index 3315d78c38..e1ed3daa3b 100644 --- a/tests/micropython/heapalloc_iter.py +++ b/tests/micropython/heapalloc_iter.py @@ -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))