Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 32 lines (27 sloc) 0.912 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

(defpackage :cl-plumbing-test
  (:use :cl :cl-plumbing :stefil :iterate)
  (:export))

(in-package :cl-plumbing-test)

(in-root-suite)

(deftest iterate-test ()
  "Test to see if the pipes work with Iterates in-stream driver."
  (let ((pipe (make-pipe)))
    (print 1 pipe)
    (print 2 pipe)
    (print 3 pipe)
    (is (equal '(1 2 3)
               (iter (for val in-stream pipe)
                 (collect val))))))

(deftest pipe-test ()
  (let ((input "hello howdy heck"))
    (let ((pipe (make-pipe)))
      (iter (for c in-sequence input)
        (write-char c pipe)
        (is (equal c (read-char pipe)))))
    (is (equal input
               (let ((pipe (make-pipe)))
                 (iter (for c in-sequence input)
                   (write-char c pipe))
                 (iter (for c = (read-char pipe nil nil))
                   (while c)
                   (collect c result-type 'string)))))))
Something went wrong with that request. Please try again.