Add queue helpers, with tests
[8sync.git] / tests / test-agenda.scm
index 9ab65f1cdf57f3ef488ded5d0f33a006f382c4b5..ef2c74f13abe7a6c20392f445fd78b6e97efe9a0 100644 (file)
       messages)))
 
 \f
       messages)))
 
 \f
-;; Timer tests
-;; ===========
+;;; queue helpers
+;;; =============
+
+(define test-q (list->q '(1 2 3)))
+(test-equal (deq! test-q) 1)
+(test-equal (deq! test-q) 2)
+(test-equal (deq! test-q) 3)
+(test-assert (q-empty? test-q))
+
+(define test-q (make-q* 'apple 'banana 'carrot))
+(test-equal (deq! test-q) 'apple)
+(test-equal (deq! test-q) 'banana)
+(test-equal (deq! test-q) 'carrot)
+(test-assert (q-empty? test-q))
+
+
+\f
+;;; Timer tests
+;;; ===========
 
 (test-assert (time= '(1 . 1) '(1 . 1)))
 (test-assert (not (time= '(1 . 1) '(1 . 0))))
 
 (test-assert (time= '(1 . 1) '(1 . 1)))
 (test-assert (not (time= '(1 . 1) '(1 . 0))))