From 10186fde0a14871cff544c52fb1837d2ddf8d938 Mon Sep 17 00:00:00 2001 From: Andy Davidoff Date: Wed, 22 Jul 2020 15:21:46 -0400 Subject: [PATCH] 0.0.3: add tock to ci --- cps.nimble | 3 ++- tests/tock.nim | 6 +++--- tests/tock.nim.cfg | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cps.nimble b/cps.nimble index 08e3db17..347b86e6 100644 --- a/cps.nimble +++ b/cps.nimble @@ -1,4 +1,4 @@ -version = "0.0.2" +version = "0.0.3" author = "disruptek" description = "continuation-passing style" license = "MIT" @@ -19,3 +19,4 @@ proc execTest(test: string) = task test, "run tests for travis": execTest("tests/test.nim") + execTest("tests/tock.nim") diff --git a/tests/tock.nim b/tests/tock.nim index 7989aef0..7d2829eb 100644 --- a/tests/tock.nim +++ b/tests/tock.nim @@ -5,9 +5,9 @@ import cps/eventqueue # cps_sleep(), trampoline, run(), Cont # a procedure that starts off synchronous and becomes asynchronous proc tock(name: string; interval: Duration): Cont {.cps.} = - var count: int = 0 - while true: - inc count + var count: int = 20 + while count > 0: + dec count # this primitive sends the continuation to the dispatcher cps_sleep interval # this is executed from the dispatcher diff --git a/tests/tock.nim.cfg b/tests/tock.nim.cfg index f9f78b32..d3a573fe 100644 --- a/tests/tock.nim.cfg +++ b/tests/tock.nim.cfg @@ -2,4 +2,4 @@ --threads:on --define:threadsafe --gc:arc ---define:cpsDebug +#--define:cpsDebug