From: Christopher Allan Webber Date: Thu, 19 Nov 2015 21:25:55 +0000 (-0600) Subject: add true-after-n-times to tests file X-Git-Tag: v0.1.0~146 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=35a90099f27585e853a8b8aee498c5228d8f9697;p=8sync.git add true-after-n-times to tests file --- diff --git a/tests.scm b/tests.scm index 0c58624..c7fe1cd 100644 --- a/tests.scm +++ b/tests.scm @@ -211,6 +211,12 @@ (if message (set! messages (append messages (list message)))) messages))) +(define (true-after-n-times n) + (let ((count 0)) + (lambda _ + (set! count (+ count 1)) + (if (>= count n) #t #f)))) + ;; the dummy test (define speaker (speak-it))