tests/micropython/heapalloc_iter: Add tests for contains and unpack.
This commit is contained in:
parent
e6003f466e
commit
7839b8b827
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user