Skip to content

Commit

Permalink
Test we not change accidentally.
Browse files Browse the repository at this point in the history
  • Loading branch information
okamsn committed Dec 6, 2024
1 parent 5b0ad66 commit c4c82d9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ SYMS-STR are the string names of symbols from `loopy-iter-bare-commands'."
(should (seqp (make-loopy--test-custom-seq :value 0 :next nil))))

(cl-defmethod seq-do (func (seq loopy--test-custom-seq))
(message "Running `seq-do' for custom seqs.")
(cl-assert (loopy--test-custom-seq-p seq)
"Non-custom-seq passed to `seq-do' for custom seqs")
(while seq
(funcall func (loopy--test-custom-seq-value seq))
(setq seq (loopy--test-custom-seq-next seq))))
Expand All @@ -266,6 +267,14 @@ SYMS-STR are the string names of symbols from `loopy-iter-bare-commands'."
:next nil))))
res))))

(ert-deftest custom-seq-do-not-affect-streams ()
"We're seeing some odd behavior in the `substream' tests after
writing a `seq-do' method for the custom seq."
(should (equal '(2 1 0)
(let ((res))
(seq-do (lambda (x) (push x res))
(stream (vector 0 1 2)))
res))))

(cl-defmethod seq-into-sequence ((seq loopy--test-custom-seq))
(let ((res nil))
Expand Down

0 comments on commit c4c82d9

Please sign in to comment.