feat(sleep) Added time tests, added sleep operator.
h3rald h3rald@h3rald.com
Fri, 03 Jun 2016 13:17:32 +0200
5 files changed,
22 insertions(+),
3 deletions(-)
M
lib/prelude.min
→
lib/prelude.min
@@ -71,6 +71,7 @@ ((() cons cons) dip swap i) :bury2
((() cons cons cons) dip swap i) :bury3 ; Other -(print pop) :print! -(put pop) :put! +(print pop) :print! +(put pop) :put! +(:ms :q :check (check) (ms sleep q) while) :interval
M
lib/sys.nim
→
lib/sys.nim
@@ -141,4 +141,10 @@ i.error errRuntime, getCurrentExceptionMsg()
else: i.error errIncorrect, "A string is required on the stack" + .symbol("sleep") do (i: In): + let ms = i.pop + if not ms.isInt: + i.error errIncorrect, "An integer is required on the stack" + sleep ms.intVal + .finalize()
M
tests/lang.min
→
tests/lang.min
@@ -3,7 +3,7 @@ #test
"lang" describe - (symbols size 157 ==) assert + (symbols size 159 ==) assert (sigils size 10 ==) assert
A
tests/time.min
@@ -0,0 +1,11 @@
+@test +#test + +"time" describe + + (timestamp 1464951736 >) assert + + (now 1464951736 >) assert + + report + clear