kopia lustrzana https://github.com/micropython/micropython
tests/basics/gc1: Add test which triggers GC threshold.
rodzic
d3cac18d49
commit
439acddc60
|
@ -27,3 +27,8 @@ if hasattr(gc, 'threshold'):
|
||||||
assert(gc.threshold() == 0)
|
assert(gc.threshold() == 0)
|
||||||
assert(gc.threshold(-1) is None)
|
assert(gc.threshold(-1) is None)
|
||||||
assert(gc.threshold() == -1)
|
assert(gc.threshold() == -1)
|
||||||
|
|
||||||
|
# Setting a low threshold should trigger collection at the list alloc
|
||||||
|
gc.threshold(1)
|
||||||
|
[[], []]
|
||||||
|
gc.threshold(-1)
|
||||||
|
|
Ładowanie…
Reference in New Issue