Skip to content

Commit

Permalink
tests/io: Add tests for sleep_ms/us(), ticks_ms/us/diff().
Browse files Browse the repository at this point in the history
Simple smoke tests, mostly for coverage.
  • Loading branch information
Paul Sokolovsky committed Oct 19, 2015
1 parent 8ee153f commit a1575de
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/io/time_ms_us.py
@@ -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)
2 changes: 2 additions & 0 deletions tests/io/time_ms_us.py.exp
@@ -0,0 +1,2 @@
True
True

0 comments on commit a1575de

Please sign in to comment.