source: project/release/4/thread-utils/trunk/tests/run.scm @ 30539

Last change on this file since 30539 was 30539, checked in by Kon Lovett, 7 years ago

add test

File size: 837 bytes
Line 
1(use test)
2(use thread-utils)
3(use srfi-18)
4
5(test-group "thread-timeout"
6  (test-assert "timeout? #f" (thread-timeout? #f))
7  (test-assert "timeout? time" (thread-timeout? (current-time)))
8  (test-assert "timeout? #" (thread-timeout? 5))
9  (test-assert "timeout? X" (not (thread-timeout? 'X)))
10  (test #f (make-thread-timeout #f))
11  (let ((t (current-time)))
12    (test "time (base ignored)" t (make-thread-timeout t 27)) )
13  (let* ((b (current-time))
14         (t (make-thread-timeout 5 b)) )
15    (test "# w/ time base" (+ 5 (time->seconds b)) (time->seconds t)) )
16  (let* ((b 5)
17         (t (make-thread-timeout 5 b)) )
18    (test "# w/ # base" (+ 5 b) (inexact->exact (time->seconds t))) )
19  (test-error "bad offset" (make-thread-timeout ""))
20  (test-error "bad base" (make-thread-timeout 5 ""))
21)
22
23;FIXME needs MORE tests
24
25(test-exit)
Note: See TracBrowser for help on using the repository browser.