tests/basics/gc1: Garbage collector threshold() coverage.

This commit is contained in:
Alex March 2016-10-27 11:31:24 +01:00 committed by Paul Sokolovsky
parent 8a49905a2f
commit 964fb2450e

View File

@ -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)