summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/gc1.py
diff options
context:
space:
mode:
authorAlex March <alex.march.dev@gmail.com>2016-10-27 11:31:24 +0100
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-10-27 22:15:42 +0300
commit964fb2450e2dd09c8db43fd6c4e1e5e472fa107a (patch)
tree064f678b1f49d45548bb6ca2678d6f16f51a5d7c /tests/basics/gc1.py
parent8a49905a2f268255cba7f7deb6c334b830d5943a (diff)
downloadmicropython-964fb2450e2dd09c8db43fd6c4e1e5e472fa107a.tar.gz
micropython-964fb2450e2dd09c8db43fd6c4e1e5e472fa107a.zip
tests/basics/gc1: Garbage collector threshold() coverage.
Diffstat (limited to 'tests/basics/gc1.py')
-rw-r--r--tests/basics/gc1.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/basics/gc1.py b/tests/basics/gc1.py
index 140c8b0a60..be6c6faed2 100644
--- a/tests/basics/gc1.py
+++ b/tests/basics/gc1.py
@@ -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)