(use-modules (tests)
             (fibers)
             (fibers channels)
             (unit-test)
             (knots queue))

(run-fibers-for-tests
 (lambda ()
   (let* ((dest-channel
           (make-channel))
          (queue-channel
           (spawn-queueing-fiber dest-channel)))

     (put-message queue-channel 1)
     (put-message queue-channel 2)
     (put-message queue-channel 3)

     (assert-equal 1 (get-message dest-channel))
     (assert-equal 2 (get-message dest-channel))
     (assert-equal 3 (get-message dest-channel)))))

(display "queue test finished successfully\n")
