Ignore:
Timestamp:
03/08/14 19:36:32 (7 years ago)
Author:
Kon Lovett
Message:

add test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/thread-utils/trunk/tests/run.scm

    r20952 r30539  
     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 TracChangeset for help on using the changeset viewer.