aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/seq-tests.el25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/seq-tests.el b/test/lisp/emacs-lisp/seq-tests.el
index 788524bedb5..495cf1e543c 100644
--- a/test/lisp/emacs-lisp/seq-tests.el
+++ b/test/lisp/emacs-lisp/seq-tests.el
@@ -197,6 +197,31 @@ Evaluate BODY for each created sequence.
197 (should (seq-every-p #'identity seq)) 197 (should (seq-every-p #'identity seq))
198 (should (seq-every-p #'test-sequences-evenp seq)))) 198 (should (seq-every-p #'test-sequences-evenp seq))))
199 199
200(ert-deftest test-seq-set-equal-p ()
201 (with-test-sequences (seq1 '(1 2 3))
202 (should (seq-set-equal-p seq1 seq1))
203 (should (seq-set-equal-p seq1 seq1 #'eq))
204
205 (with-test-sequences (seq2 '(3 2 1))
206 (should (seq-set-equal-p seq1 seq2))
207 (should (seq-set-equal-p seq2 seq1))
208 (should (seq-set-equal-p seq1 seq2 #'eq))
209 (should (seq-set-equal-p seq2 seq1 #'eq)))
210
211 (with-test-sequences (seq2 '(3 1))
212 (should-not (seq-set-equal-p seq1 seq2))
213 (should-not (seq-set-equal-p seq2 seq1))))
214
215 (should (seq-set-equal-p '("a" "b" "c")
216 '("c" "b" "a")))
217 (should-not (seq-set-equal-p '("a" "b" "c")
218 '("c" "b" "a") #'eq))
219 (should-not (seq-set-equal-p '(("a" 1) ("b" 1) ("c" 1))
220 '(("c" 2) ("b" 2) ("a" 2))))
221 (should (seq-set-equal-p '(("a" 1) ("b" 1) ("c" 1))
222 '(("c" 2) ("b" 2) ("a" 2))
223 (lambda (i1 i2) (equal (car i1) (car i2))))))
224
200(ert-deftest test-seq-empty-p () 225(ert-deftest test-seq-empty-p ()
201 (with-test-sequences (seq '(0)) 226 (with-test-sequences (seq '(0))
202 (should-not (seq-empty-p seq))) 227 (should-not (seq-empty-p seq)))