Skip to content

Commit

Permalink
protocol refactoring
Browse files Browse the repository at this point in the history
tests now pass for new seq protocol
  • Loading branch information
jaeschliman committed Sep 22, 2012
1 parent 9161e6b commit f6c0ff4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test.lisp
Expand Up @@ -6,7 +6,8 @@
(in-package #:com.clearly-useful.iterator-protocol.test)

(defun test-builtin-iterator (seq)
(assert (typep seq 'seq))
"confirm that it works as is, and after seq."
(assert (typep seq 'seqable))
(let ((it (iterator seq)))
(doseq (o seq)
(multiple-value-bind (val continue) (iterator-next! it)
Expand All @@ -18,7 +19,9 @@
(let ((s seq))
(do-iterator (x seq)
(assert (equalp x (head s)))
(setf s (tail s)))))
(setf s (tail s))))
(unless (typep seq 'seq)
(test-builtin-iterator (seq seq))))

(assert (com.clearly-useful.iterator-protocol::%seq-iterator-p
(iterator '(a b c))))
Expand Down

0 comments on commit f6c0ff4

Please sign in to comment.