From c4c82d9c66f9a255cc5b2aa72ddf1fe5e6428936 Mon Sep 17 00:00:00 2001 From: okamsn Date: Fri, 6 Dec 2024 18:31:04 -0500 Subject: [PATCH] Test we not change accidentally. --- tests/tests.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/tests.el b/tests/tests.el index bc7ddab8..08da602f 100644 --- a/tests/tests.el +++ b/tests/tests.el @@ -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)))) @@ -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))