tests/extmod: Add tests for sleep_ms/us(), ticks_ms/us/diff().

Simple smoke tests, mostly for coverage. Added to extmod based on the fact
that they're extensions to standard modules.
This commit is contained in:
Paul Sokolovsky 2015-10-20 01:53:10 +03:00
parent 9058a7031f
commit acea9352a9
2 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,12 @@
import sys
import utime
try:
utime.sleep_ms
except AttributeError:
print("SKIP")
sys.exit()
utime.sleep_ms(1)
utime.sleep_us(1)
print(utime.ticks_diff(utime.ticks_ms(), utime.ticks_ms()) <= 1)
print(utime.ticks_diff(utime.ticks_us(), utime.ticks_us()) <= 500)

View File

@ -0,0 +1,2 @@
True
True