mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 20:20:14 +01:00
tests/basics/gc1: Garbage collector threshold() coverage.
This commit is contained in:
committed by
Paul Sokolovsky
parent
8a49905a2f
commit
964fb2450e
@@ -20,3 +20,11 @@ if hasattr(gc, 'mem_free'):
|
||||
# just test they execute and return an int
|
||||
assert type(gc.mem_free()) is int
|
||||
assert type(gc.mem_alloc()) is int
|
||||
|
||||
if hasattr(gc, 'threshold'):
|
||||
# uPy has this extra function
|
||||
# check execution and returns
|
||||
assert(gc.threshold(1) is None)
|
||||
assert(gc.threshold() == 0)
|
||||
assert(gc.threshold(-1) is None)
|
||||
assert(gc.threshold() == -1)
|
||||
|
||||
Reference in New Issue
Block a user