From: Christopher Allan Webber Date: Thu, 19 Nov 2015 20:22:47 +0000 (-0600) Subject: Add tests for time deltas X-Git-Tag: v0.1.0~151 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=8153aa3f58eba2b8bc0118d224d7e74d7b434074;p=8sync.git Add tests for time deltas --- diff --git a/tests.scm b/tests.scm index f0edcfb..c9999c6 100644 --- a/tests.scm +++ b/tests.scm @@ -24,6 +24,22 @@ (test-assert (not (time-< '(7 . 8) '(7 . 2)))) (test-assert (not (time-< '(8 . 2) '(7 . 2)))) +(let ((tdelta (make-time-delta 8))) + (test-assert (time-delta? tdelta)) + (test-eqv (time-delta-sec tdelta) 8) + (test-eqv (time-delta-usec tdelta) 0) + (test-equal + (time-+ '(2 . 3) tdelta) + '(10 . 3))) + +(let ((tdelta (make-time-delta 10 1))) + (test-assert (time-delta? tdelta)) + (test-eqv (time-delta-sec tdelta) 10) + (test-eqv (time-delta-usec tdelta) 1) + (test-equal + (time-+ '(2 . 3) tdelta) + '(12 . 4))) + ;;; Schedule tests