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:
parent
9058a7031f
commit
acea9352a9
|
@ -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)
|
|
@ -0,0 +1,2 @@
|
|||
True
|
||||
True
|
Loading…
Reference in New Issue