Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 34 lines (27 sloc) 0.912 kB
1e3b7d9 The start of a test suite.
Zach Kost-Smith authored
1
2 (defpackage :cl-plumbing-test
3 (:use :cl :cl-plumbing :stefil :iterate)
4 (:export))
5
6 (in-package :cl-plumbing-test)
7
8 (in-root-suite)
9
10 (deftest iterate-test ()
11 "Test to see if the pipes work with Iterates in-stream driver."
12 (let ((pipe (make-pipe)))
13 (print 1 pipe)
14 (print 2 pipe)
15 (print 3 pipe)
16 (is (equal '(1 2 3)
17 (iter (for val in-stream pipe)
18 (collect val))))))
19
20 (deftest pipe-test ()
21 (let ((input "hello howdy heck"))
22 (let ((pipe (make-pipe)))
23 (iter (for c in-sequence input)
24 (write-char c pipe)
25 (is (equal c (read-char pipe)))))
26 (is (equal input
27 (let ((pipe (make-pipe)))
28 (iter (for c in-sequence input)
29 (write-char c pipe))
30 (iter (for c = (read-char pipe nil nil))
31 (while c)
32 (collect c result-type 'string)))))))
33
Something went wrong with that request. Please try again.