Subject: bug#75633: [PATCH] New unit-tests for cl-lib

From: "Basil L. Contovounesios" <[email-masked]>
Date: Sat, 25 Jan 2025 19:52:59 +0100

Ahmed Khanzada [2025-01-17 09:52 -0500] wrote:

> Subject: [PATCH] New unit-tests for cl-lib

Thank you for improving the test suite!
I include some comments, nits, and a patch below.

Ahmed Khanzada [2025-01-18 09:19 -0500] wrote:

> Yes, I will look into the cl-seq-tests byecompiling warnings and fix them.

The warnings drew my attention to several preexisting bugs in
cl-seq-tests.el, with us since bug#24264.  For example, none of the
tests using cl-seq--with-side-effects were actually being evaluated.

I thus took the liberty of scrutinising the file a bit closer and attach
the resulting patch.

I would like to apply it if there are no objections; otherwise feel free
to use/adapt it as desired.

> +  (should (equal '(2) (cl-remove-if-not 'evenp '(2) :key #'(lambda (x) (- x))))))
                                                           ^^^^^^^^^^^^^^^^^^^^
AKA #'-.
Also, there is no need to #'-quote lambdas, as they are self-quoting.

> +(ert-deftest cl-delete-if-test ()
> +  (let ((list (list 1 2 3 4 5)))

Only used once, and unlike the remaining test cases which use no
variable.

> +    (cl-delete-if 'evenp list)

It's more robust to check the return value of deletion functions, rather
than rely on their side effects.  This would also pacify the
byte-compiler warning.

> +(ert-deftest cl-delete-if-not-test ()
> +  (let ((list (list 1 2 3 4 5)))

Ditto re: gratuitous binding.

> +  (let ((result (cl-substitute-if 'x #'(lambda (n) t) '(1 2 3 4 5))))
                                       ^^^^^^^^^^^^^^^^
AKA (lambda (_) t)
or  #'always.
This would also pacify the byte-compiler.

> +  (let ((result (cl-count-if (lambda (x) nil) '(1 2 3 4))))
                               ^^^^^^^^^^^^^^^^
AKA (lambda (_) nil)
or  (lambda (_))
or  #'ignore.
This would also pacify the byte-compiler.

> +(ert-deftest cl-sort-test ()
> +  (let ((result (cl-sort '(3 1 4 1 5 9 2 6 5 3 5) '<)))

cl-sort and cl-stable-sort are documented as being destructive
functions, so it's unsafe to pass them an 'immutable' quoted literal;
for details see (info "(elisp) Mutability").

Passing a fresh list would also pacify the byte-compiler.

> +  (let ((result (cl-sort '("banana" "fig" "apple" "kiwi") (lambda (x y) (< (length x) (length y))) :key 'identity)))

This and other lines are slightly long.

> +  (let ((result (cl-sort (vector 3 1 4 1 5) '<)))
> +    (should (equal result (vector 1 1 3 4 5))))

While the argument to cl-sort ought to be fresh/mutable, its result can
safely be compared to a quoted value such as [1 1 3 4 5].

> +(ert-deftest cl-merge-test ()
> +  (let ((result (cl-merge 'list '(1 3 5) '(2 4 6) '<)))

Ditto re: passing a fresh value to cl-merge, which is destructive.

> +  (let ((result (cl-member-if #'(lambda (x) (< x 0)) '(1 2 3 4 5))))
                                ^^^^^^^^^^^^^^^^^^^^^^
AKA #'cl-minusp.

> +  (let ((result (cl-assoc-if-not #'(lambda (x) (> x 0)) '((1 . "one") (2 . "two") (3 . "three")))))
                                   ^^^^^^^^^^^^^^^^^^^^^^
AKA #'cl-plusp.

> +  (let ((result (cl-intersection '(1 "two" 3) '(3 "two" 4))))
> +    (should (equal result '(3))))

This assumes (not (eql "two" "two")), which I'm not sure can always be
guaranteed in the face of optimisations.  I would replace at least one
of the string literals with a fresh one.

> +(ert-deftest cl-nintersection-test ()
> +  (let ((list1 '(1 2 3 4))
> +        (list2 '(3 4 5 6)))
> +    (let ((result (cl-nintersection list1 list2)))

Ditto re: passing fresh values to cl-nintersection, which is a
destructive function.

> +      (should (equal list1 '(1 2 3 4)))
> +      (should (equal list2 '(3 4 5 6)))))

This seems dubious: list1 and list2 are quoted literals which may have
been modified by side effect.

Besides, the docstring of cl-nintersection (and other destructive
functions) explicitly claims to modify its arguments, so I don't
understand why we would want to check that they remain unmodified.

> +  (let ((list1 '(1 "two" 3))
> +        (list2 '(3 "two" 4)))
> +    (let ((result (cl-nintersection list1 list2)))

Ditto re: assuming (not (eql "two" "two")) always holds.

> +  (let ((result (cl-set-difference '((1 . "one") (2 . "two") (3 . "three"))
> +                                    '((1 . "uno") (2 . "dos"))
> +                                    :key 'car)))

Indentation.

> +  (let ((list1 '(1 2 3))
> +        (list2 '(2 3 4)))
> +    (cl-set-difference list1 list2)
> +    (should (equal list1 '(1 2 3)))
> +    (should (equal list2 '(2 3 4)))))

This assumes that modifying the literal '(1 2 3) in the list1 argument's
value will not also modify the same literal in the subsequent
(equal list1 '(1 2 3)), which I'm not sure is robust in the face of
optimisations (and similarly for list2).

To detect (the absence of) modification, I would use fresh arguments.

It also doesn't hurt to check the return value of cl-set-difference,
which would pacify the byte-compiler.

> +(ert-deftest cl-nset-difference-test ()
> +  (let ((list1 '(1 2 3 4))
> +        (list2 '(3 4 5 6)))
> +    (let ((result (cl-nset-difference list1 list2)))

Ditto re: passing fresh values to cl-nset-difference, which is a
destructive function.

> +  (let ((result (cl-set-exclusive-or '(1 2 3 4 5) '(3 4 5 6 7)))
> +        (list1 '(1 2 3 4 5))
> +        (list2 '(3 4 5 6 7)))
> +    (should (equal result '(1 2 6 7)))
> +    (should (equal list1 '(1 2 3 4 5)))
> +    (should (equal list2 '(3 4 5 6 7)))))

Ditto re: detecting modifications to quoted literals.

More importantly, list1 and list2 are not actually used.

> +(ert-deftest cl-nset-exclusive-or-test ()
> +  (let ((list1 '(1 2 3))
> +        (list2 '(3 4 5)))
> +    (let ((result (cl-nset-exclusive-or list1 list2)))

Ditto re: passing fresh values to cl-nset-exclusive-or, which is a
destructive function.

> +(ert-deftest cl-subsetp-test ()
> +  (let ((result (cl-subsetp '(1 2) '(1 2 3 4))))
> +    (should (equal result t)))

The docstring of cl-subsetp mentions a 'true' return value, and its
entry in the manual says nothing about the return value.

While 'true' generally means t, in the absence of a stronger indication
I would just accept any non-nil return value here.

> +(ert-deftest cl-lib-set-difference ()
> +(ert-deftest cl-nset-difference ()

Why are there tests for cl-set-difference and cl-nset-difference in both
cl-lib-tests.el and cl-seq-tests.el?

Thanks,
-- 
Basil

>From 8df661683c61c93661a93ff9997e9aa0da990f3e Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <[email-masked]>
Date: Sat, 25 Jan 2025 16:48:19 +0100
Subject: [PATCH] Fix cl-seq-tests.el

None of the tests using the macro cl-seq--with-side-effects were
being evaluated (since bug#24264), and other tests were not robust
against destructive operations or optimizations (since bug#24264 and
bug#75633).

* test/lisp/emacs-lisp/cl-seq-tests.el: Fit first line within 80
columns.  Remove empty Commentary section.
(cl-union-test-00): Use bug#N reference in place of URL.
(cl-seq-test-bug24264): Ditto.  Use nconc in place of append.
(cl-seq--test-list, cl-seq--test-list2, cl-seq--with-side-effects):
Remove.
(cl-seq-tests--relet*): New convenience macro replacing the need for
cl-seq--with-side-effects.
(cl-seq-fill-test, cl-seq-replace-test, cl-seq-delete-test): Use
cl-seq-tests--relet* to actually evaluate tests.  Avoid mutating
quoted literals.
(cl-seq-nsubstitute-test): Ditto.  Actually call cl-nsubstitute, not
cl-substitute.  Avoid comparing mutated argument to itself; compare
to its original copy instead.  Avoid calling cl-position on list
that is being mutated in :if predicate; use original copy instead.
(cl-seq-remove-test, cl-remove-if-not-test, cl-delete-if-not-test)
(cl-delete-duplicates-test, cl-seq-remove-duplicates-test)
(cl-seq-substitute-test, cl-seq-substitute-if-test)
(cl-seq-position-test, cl-count-if-test, cl-count-if-not-test)
(cl-member-if-test, cl-member-if-not-test, cl-assoc-if-test)
(cl-assoc-if-not-test, cl-rassoc-if-test, cl-subsetp-test):
Simplify.
(cl-remove-if-test, cl-seq-substitute-if-not-test, cl-find-if-test)
(cl-find-if-not-test, cl-position-if-test, cl-member-test)
(cl-assoc-test, cl-rassoc-test): Quote function symbols, not
lambdas.
(cl-delete-if-test): Use cl-seq-tests--relet*.  Check result of
cl-delete-if to avoid relying on its side effects, and to pacify
byte-compiler warning.
(cl-seq-mismatch-test): Avoid 'easy to misread' hidden argument.
(cl-seq-search-test): Break long line.
(cl-sort-test, cl-stable-sort-test, cl-merge-test): Avoid mutating
quoted literals.
(cl-intersection-test): Avoid comparing eql-ity of string literals.
(cl-nintersection-test, cl-nset-difference-test)
(cl-nset-exclusive-or-test): Avoid mutating quoted literals.  Don't
compare initial and final values of arguments, since they may have
been mutated.
(cl-set-difference-test, cl-set-exclusive-or-test): Use fresh
arguments to check for absence of mutation.
---
 test/lisp/emacs-lisp/cl-seq-tests.el | 898 ++++++++++++---------------
 1 file changed, 401 insertions(+), 497 deletions(-)

diff --git a/test/lisp/emacs-lisp/cl-seq-tests.el b/test/lisp/emacs-lisp/cl-seq-tests.el
index 3541a989d34..97276be3870 100644
--- a/test/lisp/emacs-lisp/cl-seq-tests.el
+++ b/test/lisp/emacs-lisp/cl-seq-tests.el
@@ -1,4 +1,4 @@
-;;; cl-seq-tests.el --- Tests for cl-seq.el functionality  -*- lexical-binding: t; -*-
+;;; cl-seq-tests.el --- Tests for cl-seq.el  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2015-2025 Free Software Foundation, Inc.
 
@@ -19,15 +19,13 @@
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
 
-;;; Commentary:
-
 ;;; Code:
 
 (require 'ert)
 (require 'cl-seq)
 
 (ert-deftest cl-union-test-00 ()
-  "Test for https://debbugs.gnu.org/22729 ."
+  "Test for bug#22729."
   (let ((str1 "foo")
         (str2 (make-string 3 ?o)))
     ;; Emacs may make two string literals eql when reading.
@@ -36,28 +34,23 @@ cl-union-test-00
     (should (equal str1 str2))
     (should (equal (cl-union (list str1) (list str2))
                    (list str2)))
-    (should (equal (cl-union (list str1) (list str2) :test 'eql)
+    (should (equal (cl-union (list str1) (list str2) :test #'eql)
                    (list str1 str2)))))
 
-(defvar cl-seq--test-list nil
-  "List used on `cl-seq' tests with side effects.")
-(defvar cl-seq--test-list2 nil
-  "List used on `cl-seq' tests with side effects.")
-
-(defmacro cl-seq--with-side-effects (list list2 &rest body)
-  "Run a test with side effects on lists; after the test restore the lists.
-LIST is the value of `cl-seq--test-list' before the test.
-LIST2, if non-nil, is the value of `cl-seq--test-list2' before the test.
-Body are forms defining the test."
-  (declare (indent 2) (debug t))
-  (let ((orig (make-symbol "orig"))
-        (orig2 (make-symbol "orig2")))
-    `(let ((,orig (copy-sequence ,list))
-           (,orig2 (copy-sequence ,list2)))
-       (unwind-protect (progn ,@body)
-         (setq cl-seq--test-list ,orig)
-         (when ,list2
-           (setq cl-seq--test-list2 ,orig2))))))
+(defmacro cl-seq-tests--relet* (binders &rest body)
+  "Like `let*', but reevaluate BINDERS before each form in BODY.
+Additionally register an `ert-info' to help identify test failures."
+  (declare (debug let) (indent 1))
+  (let ((syms (mapcar (lambda (binder)
+                        (if (consp binder) (car binder) binder))
+                      binders)))
+    (macroexp-progn
+     (mapcar (lambda (form)
+               `(ert-info (,(lambda () (pp-to-string form)) :prefix "form: ")
+                  (let* ,binders
+                    ,@(and syms `((ignore ,@syms)))
+                    ,form)))
+             body))))
 
 (ert-deftest cl-seq-endp-test ()
   (should (cl-endp '()))
@@ -77,51 +70,39 @@ cl-seq-reduce-test
 
 ;; keywords supported:  :start :end
 (ert-deftest cl-seq-fill-test ()
-  (let* ((cl-seq--test-list '(1 2 3 4 5 2 6))
-         (orig (copy-sequence cl-seq--test-list))
-         (tests '((should (equal '(b b b b b b b) (cl-fill _list 'b)))
-                  (should (equal '(1 2 3 4 b b b) (cl-fill _list 'b :start 4)))
-                  (should (equal '(b b b b 5 2 6) (cl-fill _list 'b :end 4)))
-                  (should (equal '(1 2 b b 5 2 6) (cl-fill _list 'b :start 2 :end 4)))
-                  (should (equal orig (cl-fill _list 'b :end 0))))))
-    (dolist (test tests)
-      (let ((_list cl-seq--test-list))
-        (cl-seq--with-side-effects orig nil
-          test)))))
+  (cl-seq-tests--relet* ((l (list 1 2 3 4 5 2 6))
+                         (orig (copy-sequence l)))
+    (should (equal '(b b b b b b b) (cl-fill l 'b)))
+    (should (equal '(1 2 3 4 b b b) (cl-fill l 'b :start 4)))
+    (should (equal '(b b b b 5 2 6) (cl-fill l 'b :end 4)))
+    (should (equal '(1 2 b b 5 2 6) (cl-fill l 'b :start 2 :end 4)))
+    (should (equal orig (cl-fill l 'b :end 0)))))
 
 ;; keywords supported:  :start1 :end1 :start2 :end2
 (ert-deftest cl-seq-replace-test ()
-  (let* ((cl-seq--test-list '(1 2 3 4 5 2 6))
-         (cl-seq--test-list2 (make-list 6 'a))
-         (orig  (copy-sequence cl-seq--test-list))
-         (orig2 (copy-sequence cl-seq--test-list2))
-         (tests '((should (equal '(a a a a a a 6) (cl-replace _list _list2)))
-                  (should (equal '(a a a a a a 6) (cl-replace _list _list2 :start1 0)))
-                  (should (equal '(a a a a a a 6) (cl-replace _list _list2 :start2 0)))
-                  (should (equal orig (cl-replace _list _list2 :start1 (length _list))))
-                  (should (equal orig (cl-replace _list _list2 :start2 (length _list2))))
-                  (should (equal orig (cl-replace _list _list2 :end1 0)))
-                  (should (equal orig (cl-replace _list _list2 :end2 0)))
-                  (should (equal '(1 2 3 4 a a a) (cl-replace _list _list2 :start1 4)))
-                  (should (equal '(a a a a 5 2 6) (cl-replace _list _list2 :end1 4)))
-                  (should (equal '(a a 3 4 5 2 6) (cl-replace _list _list2 :start2 4)))
-                  (should (equal '(a a a a 5 2 6) (cl-replace _list _list2 :end2 4)))
-                  (should (equal '(1 2 a a 5 2 6) (cl-replace _list _list2 :start1 2 :end1 4)))
-                  (should (equal '(a a 3 4 5 2 6) (cl-replace _list _list2 :start2 2 :end2 4))))))
-    (dolist (test tests)
-      (let ((_list cl-seq--test-list)
-            (_list2 cl-seq--test-list2))
-        (cl-seq--with-side-effects orig orig2
-          test)))))
+  (cl-seq-tests--relet* ((l1 (list 1 2 3 4 5 2 6))
+                         (l2 (make-list 6 'a))
+                         (orig1 (copy-sequence l1)))
+    (should (equal '(a a a a a a 6) (cl-replace l1 l2)))
+    (should (equal '(a a a a a a 6) (cl-replace l1 l2 :start1 0)))
+    (should (equal '(a a a a a a 6) (cl-replace l1 l2 :start2 0)))
+    (should (equal orig1 (cl-replace l1 l2 :start1 (length l1))))
+    (should (equal orig1 (cl-replace l1 l2 :start2 (length l2))))
+    (should (equal orig1 (cl-replace l1 l2 :end1 0)))
+    (should (equal orig1 (cl-replace l1 l2 :end2 0)))
+    (should (equal '(1 2 3 4 a a a) (cl-replace l1 l2 :start1 4)))
+    (should (equal '(a a a a 5 2 6) (cl-replace l1 l2 :end1 4)))
+    (should (equal '(a a 3 4 5 2 6) (cl-replace l1 l2 :start2 4)))
+    (should (equal '(a a a a 5 2 6) (cl-replace l1 l2 :end2 4)))
+    (should (equal '(1 2 a a 5 2 6) (cl-replace l1 l2 :start1 2 :end1 4)))
+    (should (equal '(a a 3 4 5 2 6) (cl-replace l1 l2 :start2 2 :end2 4)))))
 
 ;; keywords supported:  :test :test-not :key :count :start :end :from-end
 (ert-deftest cl-seq-remove-test ()
   (let ((list '(1 2 3 4 5 2 6)))
     (should (equal list (cl-remove 'foo list)))
-    (should (equal '(1 3 4 5 6) (cl-remove 2 list)))
-    (should (equal '(1 3 4 5 6) (cl-remove 2 list
-                                           :key #'identity
-                                           :test (lambda (a b) (eql a b)))))
+    (should (equal '(1 3 4 5 6)   (cl-remove 2 list)))
+    (should (equal '(1 3 4 5 6)   (cl-remove 2 list :key #'identity :test #'eql)))
     (should (equal '(1 2 3 4 2)   (cl-remove 4 list :test (lambda (a b) (> b a)))))
     (should (equal '(5 6)         (cl-remove 4 list :test-not (lambda (a b) (> b a)))))
     (should (equal '(1 3 5)       (cl-remove 'foo list :if #'cl-evenp)))
@@ -133,67 +114,58 @@ cl-seq-remove-test
     (should (equal '(1 2 3 4 5 6) (cl-remove 2 list :from-end t :count 1)))))
 
 (ert-deftest cl-remove-if-test ()
-  (should (equal '(1 3) (cl-remove-if 'cl-evenp '(1 2 3 4))))
-  (should (equal '(1 3) (cl-remove-if 'cl-evenp '(1 2 3 4) :count 2)))
-  (should (equal '(1 3 4) (cl-remove-if 'cl-evenp '(1 2 3 4) :start 1 :end 3)))
-  (should (equal '(1 3) (cl-remove-if 'cl-evenp '(1 2 3 4) :from-end t)))
-  (should (equal '(2 4) (cl-remove-if 'cl-oddp '(1 2 3 4))))
-  (should (equal '() (cl-remove-if 'cl-evenp '())))
-  (should (equal '() (cl-remove-if 'cl-evenp '(2)))))
+  (should (equal '(1 3) (cl-remove-if #'cl-evenp '(1 2 3 4))))
+  (should (equal '(1 3) (cl-remove-if #'cl-evenp '(1 2 3 4) :count 2)))
+  (should (equal '(1 3 4) (cl-remove-if #'cl-evenp '(1 2 3 4) :start 1 :end 3)))
+  (should (equal '(1 3) (cl-remove-if #'cl-evenp '(1 2 3 4) :from-end t)))
+  (should (equal '(2 4) (cl-remove-if #'cl-oddp '(1 2 3 4))))
+  (should (equal '() (cl-remove-if #'cl-evenp '())))
+  (should (equal '() (cl-remove-if #'cl-evenp '(2)))))
 
 (ert-deftest cl-remove-if-not-test ()
-  (should (equal '(2 4) (cl-remove-if-not 'cl-evenp '(1 2 3 4))))
-  (should (equal '(2 4) (cl-remove-if-not 'cl-evenp '(1 2 3 4) :count 2)))
-  (should (equal '(1 2 4) (cl-remove-if-not 'cl-evenp '(1 2 3 4) :start 1 :end 3)))
-  (should (equal '(2 4) (cl-remove-if-not 'cl-evenp '(1 2 3 4) :from-end t)))
-  (should (equal '(1 3) (cl-remove-if-not 'cl-oddp '(1 2 3 4))))
-  (should (equal '() (cl-remove-if-not 'cl-evenp '())))
-  (should (equal '(2) (cl-remove-if-not 'cl-evenp '(2))))
-  (should (equal '(2) (cl-remove-if-not 'cl-evenp '(2) :key #'(lambda (x) (- x))))))
+  (should (equal '(2 4) (cl-remove-if-not #'cl-evenp '(1 2 3 4))))
+  (should (equal '(2 4) (cl-remove-if-not #'cl-evenp '(1 2 3 4) :count 2)))
+  (should (equal '(1 2 4) (cl-remove-if-not #'cl-evenp '(1 2 3 4) :start 1 :end 3)))
+  (should (equal '(2 4) (cl-remove-if-not #'cl-evenp '(1 2 3 4) :from-end t)))
+  (should (equal '(1 3) (cl-remove-if-not #'cl-oddp '(1 2 3 4))))
+  (should (equal '() (cl-remove-if-not #'cl-evenp '())))
+  (should (equal '(2) (cl-remove-if-not #'cl-evenp '(2))))
+  (should (equal '(2) (cl-remove-if-not #'cl-evenp '(2) :key #'-))))
 
 ;; keywords supported:  :test :test-not :key :count :start :end :from-end
 (ert-deftest cl-seq-delete-test ()
-  (let* ((cl-seq--test-list '(1 2 3 4 5 2 6))
-         (orig (copy-sequence cl-seq--test-list))
-         (tests '((should (equal orig         (cl-delete 'foo _list)))
-                  (should (equal '(1 3 4 5 6) (cl-delete 2 _list)))
-                  (should (equal '(1 3 4 5 6) (cl-delete 2 _list
-                                                         :key #'identity
-                                                         :test (lambda (a b) (eql a b)))))
-                  (should (equal '(1 2 3 4 2)   (cl-delete 4 _list :test (lambda (a b) (> b a)))))
-                  (should (equal '(5 6)         (cl-delete 4 _list :test-not (lambda (a b) (> b a)))))
-                  (should (equal '(1 3 5)       (cl-delete 'foo _list :if #'cl-evenp)))
-                  (should (equal '(2 4 2 6)     (cl-delete 'foo _list :if-not #'cl-evenp)))
-                  (should (equal '(1 2 3 4 5)   (cl-delete 'foo _list :if #'cl-evenp :start 4)))
-                  (should (equal '(1 2 3 4 5 6) (cl-delete 2 _list :start 5 :end 6)))
-                  (should (equal '(1 3 4 5 2 6) (cl-delete 2 _list :count 1)))
-                  (should (equal '(1 3 4 5 2 6) (cl-delete 2 _list :from-end nil :count 1)))
-                  (should (equal '(1 2 3 4 5 6) (cl-delete 2 _list :from-end t :count 1))))))
-    (dolist (test tests)
-      (let ((_list cl-seq--test-list))
-        (cl-seq--with-side-effects orig nil
-          test)))))
+  (cl-seq-tests--relet* ((l (list 1 2 3 4 5 2 6))
+                         (orig (copy-sequence l)))
+    (should (equal orig           (cl-delete 'foo l)))
+    (should (equal '(1 3 4 5 6)   (cl-delete 2 l)))
+    (should (equal '(1 3 4 5 6)   (cl-delete 2 l :key #'identity :test #'eql)))
+    (should (equal '(1 2 3 4 2)   (cl-delete 4 l :test (lambda (a b) (> b a)))))
+    (should (equal '(5 6)         (cl-delete 4 l :test-not (lambda (a b) (> b a)))))
+    (should (equal '(1 3 5)       (cl-delete 'foo l :if #'cl-evenp)))
+    (should (equal '(2 4 2 6)     (cl-delete 'foo l :if-not #'cl-evenp)))
+    (should (equal '(1 2 3 4 5)   (cl-delete 'foo l :if #'cl-evenp :start 4)))
+    (should (equal '(1 2 3 4 5 6) (cl-delete 2 l :start 5 :end 6)))
+    (should (equal '(1 3 4 5 2 6) (cl-delete 2 l :count 1)))
+    (should (equal '(1 3 4 5 2 6) (cl-delete 2 l :from-end nil :count 1)))
+    (should (equal '(1 2 3 4 5 6) (cl-delete 2 l :from-end t :count 1)))))
 
 (ert-deftest cl-delete-if-test ()
-  (let ((list (list 1 2 3 4 5)))
-    (cl-delete-if 'cl-evenp list)
-    (should (equal '(1 3 5) list))
-    (should (equal '(1 3 5) (cl-delete-if 'cl-evenp (list 1 2 3 4 5) :start 0 :end 4)))
-    (should (equal '(1 3 5) (cl-delete-if 'cl-evenp (list 1 2 3 4 5) :from-end t)))
-    (should (equal '(2 4) (cl-delete-if 'cl-oddp (list 1 2 3 4 5))))
-    (should (equal '() (cl-delete-if 'cl-evenp '())))
-    (should (equal '() (cl-delete-if 'cl-evenp (list 2))))))
+  (cl-seq-tests--relet* ((l (list 1 2 3 4 5)))
+    (should (equal '(1 3 5) (cl-delete-if #'cl-evenp l)))
+    (should (equal '(1 3 5) (cl-delete-if #'cl-evenp l :start 0 :end 4)))
+    (should (equal '(1 3 5) (cl-delete-if #'cl-evenp l :from-end t)))
+    (should (equal '(2 4) (cl-delete-if #'cl-oddp l))))
+  (should (equal '() (cl-delete-if #'cl-evenp '())))
+  (should (equal '() (cl-delete-if #'cl-evenp (list 2)))))
 
 (ert-deftest cl-delete-if-not-test ()
-  (let ((list (list 1 2 3 4 5)))
-    (should (equal '(2 4) (cl-delete-if-not 'cl-evenp list)))
-    (should (equal '() (cl-delete-if-not 'cl-evenp '())))
-    (should (equal '() (cl-delete-if-not 'cl-evenp (list 1))))))
+  (should (equal '(2 4) (cl-delete-if-not #'cl-evenp (list 1 2 3 4 5))))
+  (should (equal '() (cl-delete-if-not #'cl-evenp '())))
+  (should (equal '() (cl-delete-if-not #'cl-evenp (list 1)))))
 
 (ert-deftest cl-delete-duplicates-test ()
-  (let ((list (list 1 2 3 2 1)))
-    (should (equal '(3 2 1) (cl-delete-duplicates list)))
-    (should (equal '() (cl-delete-duplicates '())))))
+  (should (equal '(3 2 1) (cl-delete-duplicates (list 1 2 3 2 1))))
+  (should (equal '() (cl-delete-duplicates '()))))
 
 ;; keywords supported:  :test :test-not :key :start :end :from-end
 (ert-deftest cl-seq-remove-duplicates-test ()
@@ -203,10 +175,10 @@ cl-seq-remove-duplicates-test
     (should (equal list           (cl-remove-duplicates list :start 2)))
     (should (equal list           (cl-remove-duplicates list :start 2 :from-end t)))
     (should (equal list           (cl-remove-duplicates list :end 4)))
-    (should (equal '(6)           (cl-remove-duplicates list :test (lambda (a b) (< a b)))))
-    (should (equal '(1 2 6)       (cl-remove-duplicates list :test (lambda (a b) (>= a b)))))
-    (should (equal (cl-remove-duplicates list :test (lambda (a b) (>= a b)))
-                   (cl-remove-duplicates list :test-not (lambda (a b) (< a b)))))
+    (should (equal '(6)           (cl-remove-duplicates list :test #'<)))
+    (should (equal '(1 2 6)       (cl-remove-duplicates list :test #'>=)))
+    (should (equal (cl-remove-duplicates list :test #'>=)
+                   (cl-remove-duplicates list :test-not #'<)))
     (should (equal (cl-remove-duplicates list)
                    (cl-remove-duplicates list :key #'number-to-string :test #'string=)))
     (should (equal list
@@ -224,35 +196,38 @@ cl-seq-substitute-test
     (should (equal '(1 b 3 4 5 2 6) (cl-substitute 'b 2 list :count 1)))
     (should (equal '(1 2 3 4 5 b 6) (cl-substitute 'b 2 list :count 1 :from-end t)))
     (should (equal list             (cl-substitute 'b 2 list :count -1)))
-    (should (equal '(1 b 3 4 5 b 6) (cl-substitute 'b "2" list :key #'number-to-string
+    (should (equal '(1 b 3 4 5 b 6) (cl-substitute 'b "2" list
+                                                   :key #'number-to-string
                                                    :test #'string=)))
     (should (equal (cl-substitute 'b 2 list)
                    (cl-substitute 'b 2 list :test #'eq)))
-    (should (equal '(1 2 b b b 2 b) (cl-substitute 'b 2 list :test (lambda (a b) (< a b)))))
-    (should (equal '(b b 3 4 5 b 6) (cl-substitute 'b 2 list :test (lambda (a b) (>= a b)))))
-    (should (equal list             (cl-substitute 'b 99 list :test (lambda (a b) (< a b)))))
-    (should (equal (cl-substitute 'b 2 list :test (lambda (a b) (>= a b)))
-                   (cl-substitute 'b 2 list :test-not (lambda (a b) (< a b)))))
-    (should (equal '(1 2 b b b 2 b) (cl-substitute 'b nil list :if (lambda (x) (> (cl-position x list) 1)))))
-    (should (equal '(1 b b b b b b) (cl-substitute 'b nil list :if (lambda (x) (> (cl-position x list :from-end t) 1)))))
-
-    (should (equal '(b b 3 4 5 b 6) (cl-substitute 'b nil list
-                                                   :if-not (lambda (x) (> (cl-position x list) 1)))))
-    (should (equal '(b 2 3 4 5 2 6) (cl-substitute 'b nil list
-                                                   :if-not (lambda (x) (> (cl-position x list :from-end t) 1)))))))
+    (should (equal '(1 2 b b b 2 b) (cl-substitute 'b 2 list :test #'<)))
+    (should (equal '(b b 3 4 5 b 6) (cl-substitute 'b 2 list :test #'>=)))
+    (should (equal list             (cl-substitute 'b 99 list :test #'<)))
+    (should (equal (cl-substitute 'b 2 list :test #'>=)
+                   (cl-substitute 'b 2 list :test-not #'<)))
+    (let ((pred (lambda (x) (> (cl-position x list) 1))))
+      (should (equal '(1 2 b b b 2 b) (cl-substitute 'b nil list :if pred))))
+    (let ((pred (lambda (x) (> (cl-position x list :from-end t) 1))))
+      (should (equal '(1 b b b b b b) (cl-substitute 'b nil list :if pred))))
+    (let ((pred (lambda (x) (> (cl-position x list) 1))))
+      (should (equal '(b b 3 4 5 b 6) (cl-substitute 'b nil list :if-not pred))))
+    (let ((pred (lambda (x) (> (cl-position x list :from-end t) 1))))
+      (should (equal '(b 2 3 4 5 2 6) (cl-substitute 'b nil list :if-not pred))))))
 
 (ert-deftest cl-seq-substitute-if-test ()
   (let ((result (cl-substitute-if 'x #'cl-evenp '(1 2 3 4 5))))
     (should (equal result '(1 x 3 x 5))))
   (let ((result (cl-substitute-if 'x #'cl-evenp '(1 3 5))))
     (should (equal result '(1 3 5))))
-  (let ((result (cl-substitute-if 'x #'(lambda (n) t) '(1 2 3 4 5))))
+  (let ((result (cl-substitute-if 'x #'always '(1 2 3 4 5))))
     (should (equal result '(x x x x x))))
   (let ((result (cl-substitute-if 'x #'cl-evenp '(1 2 3 4 5) :start 1 :end 4)))
     (should (equal result '(1 x 3 x 5))))
   (let ((result (cl-substitute-if 'x #'cl-oddp '(1 2 3 4 5) :from-end t)))
     (should (equal result '(x 2 x 4 x))))
-  (let ((result (cl-substitute-if 'x (lambda (n) (= n 3)) '(1 2 3 4 5) :key 'identity)))
+  (let ((result (cl-substitute-if 'x (lambda (n) (= n 3)) '(1 2 3 4 5)
+                                  :key #'identity)))
     (should (equal result '(1 2 x 4 5)))))
 
 (ert-deftest cl-seq-substitute-if-not-test ()
@@ -260,21 +235,22 @@ cl-seq-substitute-if-not-test
     (should (equal result '(x 2 x 4 x))))
   (let ((result (cl-substitute-if-not 'x #'cl-evenp '(2 4 6))))
     (should (equal result '(2 4 6))))
-  (let ((result (cl-substitute-if-not 'x #'(lambda (n) (> n 5)) '(1 2 3 4 5))))
+  (let ((result (cl-substitute-if-not 'x (lambda (n) (> n 5)) '(1 2 3 4 5))))
     (should (equal result '(x x x x x))))
   (let ((result (cl-substitute-if-not 'x #'cl-evenp '(1 2 3 4 5) :start 0 :end 4)))
     (should (equal result '(x 2 x 4 5))))
   (let ((result (cl-substitute-if-not 'x #'cl-oddp '(1 2 3 4 5) :from-end t)))
     (should (equal result '(1 x 3 x 5))))
-  (let ((result (cl-substitute-if-not 'x (lambda (n) (= n 3)) '(1 2 3 4 5) :key 'identity)))
+  (let ((result (cl-substitute-if-not 'x (lambda (n) (= n 3)) '(1 2 3 4 5)
+                                      :key #'identity)))
     (should (equal result '(x x 3 x x)))))
 
 (ert-deftest cl-find-if-test ()
   (let ((result (cl-find-if #'cl-evenp '(1 2 3 4 5))))
     (should (equal result 2)))
-  (let ((result (cl-find-if #'(lambda (n) (> n 5)) '(1 2 3 4 5))))
+  (let ((result (cl-find-if (lambda (n) (> n 5)) '(1 2 3 4 5))))
     (should (equal result nil)))
-  (let ((result (cl-find-if #'(lambda (n) (> n 3)) '(1 2 3 4 5 6 7))))
+  (let ((result (cl-find-if (lambda (n) (> n 3)) '(1 2 3 4 5 6 7))))
     (should (equal result 4)))
   (let ((result (cl-find-if #'cl-evenp '(1 2 3 4 5) :start 2)))
     (should (equal result 4)))
@@ -282,7 +258,7 @@ cl-find-if-test
     (should (equal result nil)))
   (let ((result (cl-find-if #'cl-oddp '(2 4 5 6 7) :from-end t)))
     (should (equal result 7)))
-  (let ((result (cl-find-if (lambda (n) (= n 4)) '(1 2 3 4 5) :key 'identity)))
+  (let ((result (cl-find-if (lambda (n) (= n 4)) '(1 2 3 4 5) :key #'identity)))
     (should (equal result 4))))
 
 (ert-deftest cl-find-if-not-test ()
@@ -290,7 +266,7 @@ cl-find-if-not-test
     (should (equal result 1)))
   (let ((result (cl-find-if-not #'cl-oddp '(1 3 5))))
     (should (equal result nil)))
-  (let ((result (cl-find-if-not #'(lambda (n) (< n 4)) '(1 2 3 4 5 6 7))))
+  (let ((result (cl-find-if-not (lambda (n) (< n 4)) '(1 2 3 4 5 6 7))))
     (should (equal result 4)))
   (let ((result (cl-find-if-not #'cl-evenp '(1 2 3 4 5) :start 2)))
     (should (equal result 3)))
@@ -298,45 +274,40 @@ cl-find-if-not-test
     (should (equal result 1)))
   (let ((result (cl-find-if-not #'cl-oddp '(2 4 6 7 8) :from-end t)))
     (should (equal result 8)))
-  (let ((result (cl-find-if-not (lambda (n) (= n 4)) '(1 2 3 4 5) :key 'identity)))
+  (let ((result (cl-find-if-not (lambda (n) (= n 4)) '(1 2 3 4 5) :key #'identity)))
     (should (equal result 1))))
 
 ;; keywords supported:  :test :test-not :key :count :start :end :from-end
 (ert-deftest cl-seq-nsubstitute-test ()
-  (let ((cl-seq--test-list '(1 2 3 4 5 2 6))
-        (orig (copy-sequence cl-seq--test-list))
-        (tests '((should (equal '(1 b 3 4 5 b 6) (cl-nsubstitute 'b 2 _list)))
-                 (should (equal _list (cl-substitute 'b 2 _list :start (length _list))))
-                 (should (equal _list (cl-substitute 'b 2 _list :end 0)))
-                 (should (equal '(1 2 3 4 5 b 6) (cl-substitute 'b 2 _list :start 2)))
-                 (should (equal '(1 b 3 4 5 2 6) (cl-substitute 'b 2 _list :end 2)))
-                 (should (equal _list (cl-substitute 'b 2 _list :start 2 :end 4)))
-                 (should (equal '(1 b 3 4 5 2 6) (cl-nsubstitute 'b 2 _list :count 1)))
-                 (should (equal '(1 2 3 4 5 b 6) (cl-nsubstitute 'b 2 _list :count 1 :from-end t)))
-                 (should (equal _list            (cl-nsubstitute 'b 2 _list :count -1)))
-                 (should (equal '(1 b 3 4 5 b 6) (cl-nsubstitute 'b "2" _list :key #'number-to-string
-                                                                 :test #'string=)))
-                 (should (equal (cl-nsubstitute 'b 2 _list)
-                                (cl-nsubstitute 'b 2 _list :test #'eq)))
-                 (should (equal '(1 2 b b b 2 b) (cl-nsubstitute 'b 2 _list :test (lambda (a b) (< a b)))))
-                 (should (equal '(b b 3 4 5 b 6) (cl-nsubstitute 'b 2 _list :test (lambda (a b) (>= a b)))))
-                 (should (equal _list            (cl-nsubstitute 'b 99 _list :test (lambda (a b) (< a b)))))
-                 (should (equal (cl-nsubstitute 'b 2 _list :test (lambda (a b) (>= a b)))
-                                (cl-nsubstitute 'b 2 _list :test-not (lambda (a b) (< a b)))))
-                 (should (equal '(1 2 b b b 2 b)
-                                (cl-nsubstitute 'b nil _list :if (lambda (x) (> (cl-position x _list) 1)))))
-                 (should (equal '(1 b b b b b b)
-                                (cl-nsubstitute 'b nil _list :if (lambda (x) (> (cl-position x _list :from-end t) 1)))))
-                 (should (equal '(b b 3 4 5 b 6)
-                                (cl-nsubstitute 'b nil _list
-                                                :if-not (lambda (x) (> (cl-position x _list) 1)))))
-                 (should (equal '(b 2 3 4 5 2 6)
-                                (cl-nsubstitute 'b nil _list
-                                                :if-not (lambda (x) (> (cl-position x _list :from-end t) 1))))))))
-    (dolist (test tests)
-      (let ((_list cl-seq--test-list))
-        (cl-seq--with-side-effects orig nil
-          test)))))
+  (cl-seq-tests--relet* ((l (list 1 2 3 4 5 2 6))
+                         (orig (copy-sequence l)))
+    (should (equal '(1 b 3 4 5 b 6) (cl-nsubstitute 'b 2 l)))
+    (should (equal orig (cl-nsubstitute 'b 2 l :start (length l))))
+    (should (equal orig (cl-nsubstitute 'b 2 l :end 0)))
+    (should (equal '(1 2 3 4 5 b 6) (cl-nsubstitute 'b 2 l :start 2)))
+    (should (equal '(1 b 3 4 5 2 6) (cl-nsubstitute 'b 2 l :end 2)))
+    (should (equal orig (cl-nsubstitute 'b 2 l :start 2 :end 4)))
+    (should (equal '(1 b 3 4 5 2 6) (cl-nsubstitute 'b 2 l :count 1)))
+    (should (equal '(1 2 3 4 5 b 6) (cl-nsubstitute 'b 2 l :count 1 :from-end t)))
+    (should (equal orig (cl-nsubstitute 'b 2 l :count -1)))
+    (should (equal '(1 b 3 4 5 b 6) (cl-nsubstitute 'b "2" l
+                                                    :key #'number-to-string
+                                                    :test #'string=)))
+    (should (equal (cl-nsubstitute 'b 2 orig)
+                   (cl-nsubstitute 'b 2 l :test #'eq)))
+    (should (equal '(1 2 b b b 2 b) (cl-nsubstitute 'b 2 l :test #'<)))
+    (should (equal '(b b 3 4 5 b 6) (cl-nsubstitute 'b 2 l :test #'>=)))
+    (should (equal orig (cl-nsubstitute 'b 99 l :test #'<)))
+    (should (equal (cl-nsubstitute 'b 2 orig :test #'>=)
+                   (cl-nsubstitute 'b 2 l :test-not #'<)))
+    (let ((pred (lambda (x) (> (cl-position x orig) 1))))
+      (should (equal '(1 2 b b b 2 b) (cl-nsubstitute 'b nil l :if pred))))
+    (let ((pred (lambda (x) (> (cl-position x orig :from-end t) 1))))
+      (should (equal '(1 b b b b b b) (cl-nsubstitute 'b nil l :if pred))))
+    (let ((pred (lambda (x) (> (cl-position x orig) 1))))
+      (should (equal '(b b 3 4 5 b 6) (cl-nsubstitute 'b nil l :if-not pred))))
+    (let ((pred (lambda (x) (> (cl-position x orig :from-end t) 1))))
+      (should (equal '(b 2 3 4 5 2 6) (cl-nsubstitute 'b nil l :if-not pred))))))
 
 ;; keywords supported:  :test :test-not :key :start :end :from-end
 (ert-deftest cl-seq-position-test ()
@@ -346,10 +317,10 @@ cl-seq-position-test
     (should (= 5 (cl-position 2 list :start 5 :end 6)))
     (should (= 1 (cl-position 2 list :from-end nil)))
     (should (= 5 (cl-position 2 list :from-end t)))
-    (should (cl-position 2 list :key #'identity
-                         :test (lambda (a b) (eql a b))))
+    (should (cl-position 2 list :key #'identity :test #'eql))
     (should (= 1 (cl-position "2" list :key #'number-to-string :test #'string=)))
-    (should (= 5 (cl-position "2" list :key #'number-to-string :test #'string= :from-end t)))
+    (should (= 5 (cl-position "2" list :key #'number-to-string
+                              :test #'string= :from-end t)))
     (should-not (cl-position "2" list :key #'number-to-string))
     (should (cl-position 5 list :key (lambda (x) (1+ (* 1.0 x x))) :test #'=))
     (should-not (cl-position 5 list :key (lambda (x) (1+ (* 1.0 x x)))))
@@ -359,9 +330,9 @@ cl-seq-position-test
 (ert-deftest cl-position-if-test ()
   (let ((result (cl-position-if #'cl-evenp '(1 2 3 4 5))))
     (should (equal result 1)))
-  (let ((result (cl-position-if #'(lambda (n) (> n 5)) '(1 2 3 4 5))))
+  (let ((result (cl-position-if (lambda (n) (> n 5)) '(1 2 3 4 5))))
     (should (equal result nil)))
-  (let ((result (cl-position-if #'(lambda (n) (> n 3)) '(1 2 3 4 5 6 7))))
+  (let ((result (cl-position-if (lambda (n) (> n 3)) '(1 2 3 4 5 6 7))))
     (should (equal result 3)))
   (let ((result (cl-position-if #'cl-evenp '(1 2 3 4 5) :start 2)))
     (should (equal result 3)))
@@ -369,7 +340,7 @@ cl-position-if-test
     (should (equal result nil)))
   (let ((result (cl-position-if #'cl-oddp '(2 4 5 6 7) :from-end t)))
     (should (equal result 4)))
-  (let ((result (cl-position-if (lambda (n) (= n 4)) '(1 2 3 4 5) :key 'identity)))
+  (let ((result (cl-position-if (lambda (n) (= n 4)) '(1 2 3 4 5) :key #'identity)))
     (should (equal result 3))))
 
 ;; keywords supported:  :test :test-not :key :start :end
@@ -390,11 +361,11 @@ cl-count-if-test
     (should (equal result 2)))
   (let ((result (cl-count-if #'cl-oddp '(2 4 6 8))))
     (should (equal result 0)))
-  (let ((result (cl-count-if (lambda (x) t) '(1 2 3 4))))
+  (let ((result (cl-count-if #'always '(1 2 3 4))))
     (should (equal result 4)))
-  (let ((result (cl-count-if (lambda (x) nil) '(1 2 3 4))))
+  (let ((result (cl-count-if #'ignore '(1 2 3 4))))
     (should (equal result 0)))
-  (let ((result (cl-count-if #'(lambda (x) (> x 2)) '(1 2 3 4 5) :key 'identity)))
+  (let ((result (cl-count-if (lambda (x) (> x 2)) '(1 2 3 4 5) :key #'identity)))
     (should (equal result 3)))
   (let ((result (cl-count-if #'cl-evenp '(1 2 3 4 5) :start 2)))
     (should (equal result 1)))
@@ -402,7 +373,7 @@ cl-count-if-test
     (should (equal result 1)))
   (let ((result (cl-count-if #'cl-evenp '())))
     (should (equal result 0)))
-  (let ((result (cl-count-if #'(lambda (x) (numberp x)) '(1 "two" 3 4 "five" 6))))
+  (let ((result (cl-count-if #'numberp '(1 "two" 3 4 "five" 6))))
     (should (equal result 4)))
   (let ((result (cl-count-if (lambda (x) (and (numberp x) (> x 2))) '(1 2 3 4 5 6))))
     (should (equal result 4))))
@@ -412,11 +383,11 @@ cl-count-if-not-test
     (should (equal result 3)))
   (let ((result (cl-count-if-not #'cl-oddp '(1 3 5))))
     (should (equal result 0)))
-  (let ((result (cl-count-if-not (lambda (x) t) '(1 2 3 4))))
+  (let ((result (cl-count-if-not #'always '(1 2 3 4))))
     (should (equal result 0)))
-  (let ((result (cl-count-if-not (lambda (x) nil) '(1 2 3 4))))
+  (let ((result (cl-count-if-not #'ignore '(1 2 3 4))))
     (should (equal result 4)))
-  (let ((result (cl-count-if-not #'(lambda (x) (> x 3)) '(1 2 3 4 5) :key 'identity)))
+  (let ((result (cl-count-if-not (lambda (x) (> x 3)) '(1 2 3 4 5) :key #'identity)))
     (should (equal result 3)))
   (let ((result (cl-count-if-not #'cl-evenp '(1 2 3 4 5) :start 2)))
     (should (equal result 2)))
@@ -424,9 +395,10 @@ cl-count-if-not-test
     (should (equal result 2)))
   (let ((result (cl-count-if-not #'cl-evenp '())))
     (should (equal result 0)))
-  (let ((result (cl-count-if-not #'(lambda (x) (numberp x)) '(1 "two" 3 4 "five" 6))))
+  (let ((result (cl-count-if-not #'numberp '(1 "two" 3 4 "five" 6))))
     (should (equal result 2)))
-  (let ((result (cl-count-if-not (lambda (x) (and (numberp x) (> x 2))) '(1 2 3 4 5 6))))
+  (let ((result (cl-count-if-not (lambda (x) (and (numberp x) (> x 2)))
+                                 '(1 2 3 4 5 6))))
     (should (equal result 2))))
 
 ;; keywords supported:  :test :test-not :key :start1 :end1 :start2 :end2 :from-end
@@ -443,9 +415,9 @@ cl-seq-mismatch-test
     (should-not (cl-mismatch list list2 :end1 1 :end2 1))
     (should-not (cl-mismatch list list2 :start1 1 :start2 2))
     (should (= 1 (cl-mismatch list list2 :start1 1 :end1 2 :start2 4 :end2 4)))
-    (should (= -1 (cl-mismatch list list2 :key #'number-to-string
+    (should (= -1 (cl-mismatch list list2 :from-end t :key #'number-to-string
                                :test (lambda (a b)
-                                       (and (stringp a) (stringp b))) :from-end t)))
+                                       (and (stringp a) (stringp b))))))
     (should (= 7 (cl-mismatch list list2 :key #'number-to-string
                               :test (lambda (a b)
                                       (and (stringp a) (stringp b))))))))
@@ -461,16 +433,17 @@ cl-seq-search-test
     (should (= 0 (cl-search list list2 :end1 1)))
     (should (= 0 (cl-search nil list2)))
     (should (= 2 (cl-search list list2 :start1 1 :end1 2 :end2 3)))
-    (should (= 0 (cl-search list list2 :test (lambda (a b) (and (numberp a) (numberp b))))))
+    (should (= 0 (cl-search list list2 :test (lambda (a b)
+                                               (and (numberp a) (numberp b))))))
     (should (= 0 (cl-search list list2 :key (lambda (x) (and (numberp x) 'foo))
                             :test (lambda (a b) (and (eq a 'foo) (eq b 'foo))))))
     (should (= 1 (cl-search (nthcdr 2 list) (nthcdr 2 list2))))
     (should (= 3 (cl-search (nthcdr 2 list) list2)))))
 
 (ert-deftest cl-seq-test-bug24264 ()
-  "Test for https://debbugs.gnu.org/24264 ."
+  "Test for bug#24264."
   :tags '(:expensive-test)
-  (let ((list  (append (make-list 8000005 1) '(8)))
+  (let ((list  (nconc (make-list 8000005 1) '(8)))
         (list2 (make-list 8000005 2)))
     (should (cl-position 8 list))
     (should-not (equal '(8) (last (cl-remove 8 list))))
@@ -488,75 +461,82 @@ cl-seq-bignum-eql
       (should (eq (cl-rassoc x a) (cadr a))))))
 
 (ert-deftest cl-sort-test ()
-  (let ((result (cl-sort '(3 1 4 1 5 9 2 6 5 3 5) '<)))
+  (let ((result (cl-sort (list 3 1 4 1 5 9 2 6 5 3 5) #'<)))
     (should (equal result '(1 1 2 3 3 4 5 5 5 6 9))))
-  (let ((result (cl-sort '(5 3 2 8 1 4) '>)))
+  (let ((result (cl-sort (list 5 3 2 8 1 4) #'>)))
     (should (equal result '(8 5 4 3 2 1))))
-  (let ((result (cl-sort '("banana" "apple" "cherry") 'string<)))
+  (let ((result (cl-sort (list "banana" "apple" "cherry") #'string<)))
     (should (equal result '("apple" "banana" "cherry"))))
-  (let ((result (cl-sort '("banana" "fig" "apple" "kiwi") (lambda (x y) (< (length x) (length y))) :key 'identity)))
+  (let ((result (cl-sort (list "banana" "fig" "apple" "kiwi")
+                         (lambda (x y) (length< x (length y)))
+                         :key #'identity)))
     (should (equal result '("fig" "kiwi" "apple" "banana"))))
-  (let ((result (cl-sort (vector 3 1 4 1 5) '<)))
-    (should (equal result (vector 1 1 3 4 5))))
-  (let ((result (cl-sort '(1 2 3 4 5) '<)))
+  (let ((result (cl-sort (vector 3 1 4 1 5) #'<)))
+    (should (equal result [1 1 3 4 5])))
+  (let ((result (cl-sort (list 1 2 3 4 5) #'<)))
     (should (equal result '(1 2 3 4 5))))
-  (let ((result (cl-sort '(-3 1 4 -1 -5 9) '<)))
+  (let ((result (cl-sort (list -3 1 4 -1 -5 9) #'<)))
     (should (equal result '(-5 -3 -1 1 4 9))))
-  (let ((result (cl-sort '(1 2 3 4 5) (lambda (x y) (> x y)))))
+  (let ((result (cl-sort (list 1 2 3 4 5) #'>)))
     (should (equal result '(5 4 3 2 1))))
-  (let ((result (cl-sort '() '<)))
+  (let ((result (cl-sort '() #'<)))
     (should (equal result '())))
-  (let ((result (cl-sort '("Banana" "apple" "cherry") 'string< :key 'downcase)))
+  (let ((result (cl-sort (list "Banana" "apple" "cherry")
+                         #'string< :key #'downcase)))
     (should (equal result '("apple" "Banana" "cherry")))) )
 
 (ert-deftest cl-stable-sort-test ()
-  (let ((result (cl-stable-sort '(3 1 4 1 5 9 2 6 5 3 5) '<)))
+  (let ((result (cl-stable-sort (list 3 1 4 1 5 9 2 6 5 3 5) #'<)))
     (should (equal result '(1 1 2 3 3 4 5 5 5 6 9))))
-  (let ((result (cl-stable-sort '(5 3 2 8 1 4) '>)))
+  (let ((result (cl-stable-sort (list 5 3 2 8 1 4) #'>)))
     (should (equal result '(8 5 4 3 2 1))))
-  (let ((result (cl-stable-sort '("banana" "apple" "cherry") 'string<)))
+  (let ((result (cl-stable-sort (list "banana" "apple" "cherry") #'string<)))
     (should (equal result '("apple" "banana" "cherry"))))
-  (let ((result (cl-stable-sort '("banana" "fig" "apple" "kiwi") (lambda (x y) (< (length x) (length y))) :key 'identity)))
+  (let ((result (cl-stable-sort (list "banana" "fig" "apple" "kiwi")
+                                (lambda (x y) (length< x (length y)))
+                                :key #'identity)))
     (should (equal result '("fig" "kiwi" "apple" "banana"))))
-  (let ((result (cl-stable-sort (vector 3 1 4 1 5) '<)))
-    (should (equal result (vector 1 1 3 4 5))))
-  (let ((result (cl-stable-sort '(1 2 3 4 5) '<)))
+  (let ((result (cl-stable-sort (vector 3 1 4 1 5) #'<)))
+    (should (equal result [1 1 3 4 5])))
+  (let ((result (cl-stable-sort (list 1 2 3 4 5) #'<)))
     (should (equal result '(1 2 3 4 5))))
-  (let ((result (cl-stable-sort '(-3 1 4 -1 -5 9) '<)))
+  (let ((result (cl-stable-sort (list -3 1 4 -1 -5 9) #'<)))
     (should (equal result '(-5 -3 -1 1 4 9))))
-  (let ((result (cl-stable-sort '(1 2 3 4 5) (lambda (x y) (> x y)))))
+  (let ((result (cl-stable-sort (list 1 2 3 4 5) #'>)))
     (should (equal result '(5 4 3 2 1))))
-  (let ((result (cl-stable-sort '() '<)))
+  (let ((result (cl-stable-sort '() #'<)))
     (should (equal result '())))
-  (let ((result (cl-stable-sort '("Banana" "apple" "cherry") 'string< :key 'downcase)))
+  (let ((result (cl-stable-sort (list "Banana" "apple" "cherry")
+                                #'string< :key #'downcase)))
     (should (equal result '("apple" "Banana" "cherry")))) )
 
 (ert-deftest cl-merge-test ()
-  (let ((result (cl-merge 'list '(1 3 5) '(2 4 6) '<)))
+  (let ((result (cl-merge 'list (list 1 3 5) (list 2 4 6) #'<)))
     (should (equal result '(1 2 3 4 5 6))))
-  (let ((result (cl-merge 'list '(1 3 3 5) '(2 3 4 6) '<)))
+  (let ((result (cl-merge 'list (list 1 3 3 5) (list 2 3 4 6) #'<)))
     (should (equal result '(1 2 3 3 3 4 5 6))))
-  (let ((result (cl-merge 'list '() '(2 4 6) '<)))
+  (let ((result (cl-merge 'list '() (list 2 4 6) #'<)))
     (should (equal result '(2 4 6))))
-  (let ((result (cl-merge 'list '(1 3 5) '() '<)))
+  (let ((result (cl-merge 'list (list 1 3 5) '() #'<)))
     (should (equal result '(1 3 5))))
-  (let ((result (cl-merge 'list '() '() '<)))
+  (let ((result (cl-merge 'list '() '() #'<)))
     (should (equal result '())))
-  (let ((result (cl-merge 'list '(1 4 6) '(2 3 5) '< :key (lambda (x) x))))
+  (let ((result (cl-merge 'list (list 1 4 6) (list 2 3 5) #'< :key #'identity)))
     (should (equal result '(1 2 3 4 5 6))))
-  (let ((result (cl-merge 'vector (vector 1 3 5) (vector 2 4 6) '<)))
-    (should (equal result (vector 1 2 3 4 5 6))))
-  (let ((result (cl-merge 'list '(5 3 1) '(6 4 2) '>)))
+  (let ((result (cl-merge 'vector (vector 1 3 5) (vector 2 4 6) #'<)))
+    (should (equal result [1 2 3 4 5 6])))
+  (let ((result (cl-merge 'list (list 5 3 1) (list 6 4 2) #'>)))
     (should (equal result '(6 5 4 3 2 1))))
-  (let ((result (cl-merge 'list '(1 2 3) '(1 2 3) '>)))
+  (let ((result (cl-merge 'list (list 1 2 3) (list 1 2 3) #'>)))
     (should (equal result '(1 2 3 1 2 3))))
-  (let ((result (cl-merge 'list '(1 2) '(3 4 5) '<)))
+  (let ((result (cl-merge 'list (list 1 2) (list 3 4 5) #'<)))
     (should (equal result '(1 2 3 4 5))))
-  (let ((result (cl-merge 'list '(4 5 6) '(1 2 3) '<)))
+  (let ((result (cl-merge 'list (list 4 5 6) (list 1 2 3) #'<)))
     (should (equal result '(1 2 3 4 5 6))))
-  (let ((result (cl-merge 'list '(1 2 3) '(1.5 2.5 3.5) '<)))
+  (let ((result (cl-merge 'list (list 1 2 3) (list 1.5 2.5 3.5) #'<)))
     (should (equal result '(1 1.5 2 2.5 3 3.5))))
-  (let ((result (cl-merge 'list '(1 2 3) '(10 20 30) '< :key (lambda (x) (* x 10)))))
+  (let ((result (cl-merge 'list (list 1 2 3) (list 10 20 30)
+                          #'< :key (lambda (x) (* x 10)))))
     (should (equal result '(1 2 3 10 20 30)))))
 
 (ert-deftest cl-member-test ()
@@ -566,45 +546,49 @@ cl-member-test
     (should (equal result nil)))
   (let ((result (cl-member 'a '(a b a c d))))
     (should (equal result '(a b a c d))))
-  (let ((result (cl-member "test" '("test" "not-test" "test2") :test 'string=)))
+  (let ((result (cl-member "test" '("test" "not-test" "test2") :test #'string=)))
     (should (equal result '("test" "not-test" "test2"))))
-  (let ((result (cl-member 'x '(a b c d) :test-not 'eq)))
+  (let ((result (cl-member 'x '(a b c d) :test-not #'eq)))
     (should (equal result '(a b c d))))
-  (let ((result (cl-member 3 '(1 2 3 4 5) :key 'identity)))
+  (let ((result (cl-member 3 '(1 2 3 4 5) :key #'identity)))
     (should (equal result '(3 4 5))))
-  (let ((result (cl-member 2.5 '(1 2 2.5 3) :test 'equal)))
+  (let ((result (cl-member 2.5 '(1 2 2.5 3) :test #'equal)))
     (should (equal result '(2.5 3))))
-  (let ((result (cl-member 'a '(a a a a) :test 'eq)))
+  (let ((result (cl-member 'a '(a a a a) :test #'eq)))
     (should (equal result '(a a a a))))
   (let ((result (cl-member 'a '())))
     (should (equal result nil)))
-  (let ((result (cl-member 'b '(a c d) :test-not 'eq)))
+  (let ((result (cl-member 'b '(a c d) :test-not #'eq)))
     (should (equal result '(a c d))))
-  (let ((result (cl-member 3 '(1 2 3 4 5) :key '1+)))
+  (let ((result (cl-member 3 '(1 2 3 4 5) :key #'1+)))
     (should (equal result '(2 3 4 5)))))
 
 (ert-deftest cl-member-if-test ()
   (let ((result (cl-member-if #'cl-evenp '(1 2 3 4 5))))
     (should (equal result '(2 3 4 5))))
-  (let ((result (cl-member-if #'(lambda (x) nil) '(1 2 3 4 5))))
+  (let ((result (cl-member-if #'ignore '(1 2 3 4 5))))
     (should (equal result nil)))
-  (let ((result (cl-member-if #'(lambda (x) t) '(1 2 3 4 5))))
+  (let ((result (cl-member-if #'always '(1 2 3 4 5))))
     (should (equal result '(1 2 3 4 5))))
-  (let ((result (cl-member-if #'(lambda (x) (= x 1)) '(1 2 3 4 5))))
+  (let ((result (cl-member-if (lambda (x) (= x 1)) '(1 2 3 4 5))))
     (should (equal result '(1 2 3 4 5))))
-  (let ((result (cl-member-if #'(lambda (x) (and (numberp x) (cl-evenp x))) '(1 3 5 4 2))))
+  (let ((result (cl-member-if (lambda (x) (and (numberp x) (cl-evenp x)))
+                              '(1 3 5 4 2))))
     (should (equal result '(4 2))))
-  (let ((result (cl-member-if (lambda (x) (string= (number-to-string x) "3")) '(1 2 3 4 5) :key 'identity)))
+  (let ((result (cl-member-if (lambda (x) (string= (number-to-string x) "3"))
+                              '(1 2 3 4 5) :key #'identity)))
     (should (equal result '(3 4 5))))
-  (let ((result (cl-member-if #'(lambda (x) (eq x 'a)) '(a a a a))))
+  (let ((result (cl-member-if (lambda (x) (eq x 'a)) '(a a a a))))
     (should (equal result '(a a a a))))
   (let ((result (cl-member-if #'cl-evenp '())))
     (should (equal result nil)))
-  (let ((result (cl-member-if #'(lambda (x) (< x 0)) '(1 2 3 4 5))))
+  (let ((result (cl-member-if #'cl-minusp '(1 2 3 4 5))))
     (should (equal result nil)))
-  (let ((result (cl-member-if (lambda (x) (and (numberp x) (<= x 2))) '(1 "two" 3 0))))
+  (let ((result (cl-member-if (lambda (x) (and (numberp x) (<= x 2)))
+                              '(1 "two" 3 0))))
     (should (equal result '(1 "two" 3 0))))
-  (let ((result (cl-member-if (lambda (x) (> x 5)) '(1 2 3 6 7 8) :key 'identity)))
+  (let ((result (cl-member-if (lambda (x) (> x 5)) '(1 2 3 6 7 8)
+                              :key #'identity)))
     (should (equal result '(6 7 8)))))
 
 (ert-deftest cl-member-if-not-test ()
@@ -612,23 +596,27 @@ cl-member-if-not-test
     (should (equal result '(1 2 3 4 5))))
   (let ((result (cl-member-if-not #'cl-evenp '(2 4 6 8 10 11))))
     (should (equal result '(11))))
-  (let ((result (cl-member-if-not #'(lambda (x) (> x 5)) '(1 2 3 4 5))))
+  (let ((result (cl-member-if-not (lambda (x) (> x 5)) '(1 2 3 4 5))))
     (should (equal result '(1 2 3 4 5))))
-  (let ((result (cl-member-if-not #'(lambda (x) t) '(1 2 3 4 5))))
+  (let ((result (cl-member-if-not #'always '(1 2 3 4 5))))
     (should (equal result nil)))
-  (let ((result (cl-member-if-not #'(lambda (x) (= x 1)) '(1 2 3 4 5))))
+  (let ((result (cl-member-if-not (lambda (x) (= x 1)) '(1 2 3 4 5))))
     (should (equal result '(2 3 4 5))))
-  (let ((result (cl-member-if-not (lambda (x) (string= (number-to-string x) "2")) '(1 2 3 4 5) :key 'identity)))
+  (let ((result (cl-member-if-not (lambda (x) (string= (number-to-string x) "2"))
+                                  '(1 2 3 4 5) :key #'identity)))
     (should (equal result '(1 2 3 4 5))))
   (let ((result (cl-member-if-not #'cl-evenp '())))
     (should (equal result nil)))
-  (let ((result (cl-member-if-not #'(lambda (x) (eq x 'a)) '(a a a a))))
+  (let ((result (cl-member-if-not (lambda (x) (eq x 'a)) '(a a a a))))
     (should (equal result nil)))
-  (let ((result (cl-member-if-not #'(lambda (x) (< x 0)) '(1 2 3 4 5))))
+  (let ((result (cl-member-if-not #'cl-minusp '(1 2 3 4 5))))
     (should (equal result '(1 2 3 4 5))))
-  (let ((result (cl-member-if-not #'(lambda (x) (or (numberp x) (stringp x) (eq x 'b))) '(a "b" 3 nil))))
+  (let ((result (cl-member-if-not
+                 (lambda (x) (or (numberp x) (stringp x) (eq x 'b)))
+                 '(a "b" 3 nil))))
     (should (equal result '(a "b" 3 nil))))
-  (let ((result (cl-member-if-not (lambda (x) (numberp x)) '(1 "two" 3 "four" 5) :key 'identity)))
+  (let ((result (cl-member-if-not #'numberp '(1 "two" 3 "four" 5)
+                                  :key #'identity)))
     (should (equal result '("two" 3 "four" 5)))))
 
 (ert-deftest cl-assoc-test ()
@@ -636,13 +624,13 @@ cl-assoc-test
     (should (equal result '(b . 2))))
   (let ((result (cl-assoc 'x '((a . 1) (b . 2) (c . 3)))))
     (should (equal result nil)))
-  (let ((result (cl-assoc "key" '(("key" . 1) ("not-key" . 2)) :test 'string=)))
+  (let ((result (cl-assoc "key" '(("key" . 1) ("not-key" . 2)) :test #'string=)))
     (should (equal result '("key" . 1))))
-  (let ((result (cl-assoc 'a '((a . 1) (b . 2) (c . 3)) :test-not 'eq)))
+  (let ((result (cl-assoc 'a '((a . 1) (b . 2) (c . 3)) :test-not #'eq)))
     (should (equal result '(b . 2))))
-  (let ((result (cl-assoc '2 '((1 . 'a) (2 . 'b) (3 . 'c)) :key 'identity)))
+  (let ((result (cl-assoc '2 '((1 . 'a) (2 . 'b) (3 . 'c)) :key #'identity)))
     (should (equal result '(2 . 'b))))
-  (let ((result (cl-assoc 'a '((a . 1) (a . 2) (a . 3)) :test 'eq)))
+  (let ((result (cl-assoc 'a '((a . 1) (a . 2) (a . 3)) :test #'eq)))
     (should (equal result '(a . 1))))
   (let ((result (cl-assoc 'a '())))
     (should (equal result nil)))
@@ -650,105 +638,142 @@ cl-assoc-test
     (should (equal result '(b . 2)))))
 
 (ert-deftest cl-assoc-if-test ()
-  (let ((result (cl-assoc-if #'cl-evenp '((1 . "odd") (2 . "even") (3 . "odd") (4 . "even")))))
+  (let ((result (cl-assoc-if #'cl-evenp
+                             '((1 . "odd") (2 . "even") (3 . "odd") (4 . "even")))))
     (should (equal result '(2 . "even"))))
-  (let ((result (cl-assoc-if #'(lambda (x) (= x 5)) '((1 . "one") (2 . "two") (3 . "three")))))
+  (let ((result (cl-assoc-if (lambda (x) (= x 5))
+                             '((1 . "one") (2 . "two") (3 . "three")))))
     (should (equal result nil)))
-  (let ((result (cl-assoc-if #'(lambda (x) (= x 1)) '((1 . "one") (2 . "two") (3 . "three")))))
+  (let ((result (cl-assoc-if (lambda (x) (= x 1))
+                             '((1 . "one") (2 . "two") (3 . "three")))))
     (should (equal result '(1 . "one"))))
-  (let ((result (cl-assoc-if #'(lambda (x) (string= x "baz")) '((foo . 1) (bar . 2) (baz . 3)))))
+  (let ((result (cl-assoc-if (lambda (x) (string= x "baz"))
+                             '((foo . 1) (bar . 2) (baz . 3)))))
     (should (equal result '(baz . 3))))
-  (let ((result (cl-assoc-if (lambda (x) (and (numberp x) (> x 2))) '((1 . "one") (3 . "three") (4 . "four")))))
+  (let ((result (cl-assoc-if (lambda (x) (and (numberp x) (> x 2)))
+                             '((1 . "one") (3 . "three") (4 . "four")))))
     (should (equal result '(3 . "three"))))
-  (let ((result (cl-assoc-if #'(lambda (x) (> x 1)) '((0 . "zero") (1 . "one") (2 . "two")))))
+  (let ((result (cl-assoc-if (lambda (x) (> x 1))
+                             '((0 . "zero") (1 . "one") (2 . "two")))))
     (should (equal result '(2 . "two"))))
   (let ((result (cl-assoc-if #'cl-evenp '())))
     (should (equal result nil)))
-  (let ((result (cl-assoc-if #'(lambda (x) (eq x 'a)) '((a . "first") (a . "second") (b . "third")))))
+  (let ((result (cl-assoc-if (lambda (x) (eq x 'a))
+                             '((a . "first") (a . "second") (b . "third")))))
     (should (equal result '(a . "first"))))
-  (let ((result (cl-assoc-if #'(lambda (x) (and (symbolp x) (not (eq x 'b)))) '((b . "b") (c . "c") (d . "d")))))
+  (let ((result (cl-assoc-if (lambda (x) (and (symbolp x) (not (eq x 'b))))
+                             '((b . "b") (c . "c") (d . "d")))))
     (should (equal result '(c . "c"))))
-  (let ((result (cl-assoc-if (lambda (x) (and (listp x) (> (length x) 1))) '(((1 2) . "pair 1") ((1) . "pair 2")))))
+  (let ((result (cl-assoc-if #'cdr '(((1 2) . "pair 1") ((1) . "pair 2")))))
     (should (equal result '((1 2) . "pair 1")))))
 
 (ert-deftest cl-assoc-if-not-test ()
-  (let ((result (cl-assoc-if-not #'cl-evenp '((1 . "odd") (2 . "even") (3 . "odd") (4 . "even")))))
+  (let* ((alist '((1 . "odd") (2 . "even") (3 . "odd") (4 . "even")))
+         (result (cl-assoc-if-not #'cl-evenp alist)))
     (should (equal result '(1 . "odd"))))
-  (let ((result (cl-assoc-if-not #'(lambda (x) (> x 0)) '((1 . "one") (2 . "two") (3 . "three")))))
+  (let ((result (cl-assoc-if-not #'cl-plusp
+                                 '((1 . "one") (2 . "two") (3 . "three")))))
     (should (equal result nil)))
-  (let ((result (cl-assoc-if-not #'(lambda (x) (< x 5)) '((1 . "one") (2 . "two") (3 . "three")))))
+  (let ((result (cl-assoc-if-not (lambda (x) (< x 5))
+                                 '((1 . "one") (2 . "two") (3 . "three")))))
     (should (equal result nil)))
-  (let ((result (cl-assoc-if-not #'(lambda (x) (= x 1)) '((1 . "one") (2 . "two") (3 . "three")))))
+  (let ((result (cl-assoc-if-not (lambda (x) (= x 1))
+                                 '((1 . "one") (2 . "two") (3 . "three")))))
     (should (equal result '(2 . "two"))))
-  (let ((result (cl-assoc-if-not #'(lambda (x) (string= x "baz")) '((foo . "first") (bar . "second") (baz . "third")))))
+  (let ((result (cl-assoc-if-not
+                 (lambda (x) (string= x "baz"))
+                 '((foo . "first") (bar . "second") (baz . "third")))))
     (should (equal result '(foo . "first"))))
-  (let ((result (cl-assoc-if-not (lambda (x) (and (numberp x) (> x 2))) '((1 . "one") (3 . "three") (4 . "four")))))
+  (let ((result (cl-assoc-if-not (lambda (x) (and (numberp x) (> x 2)))
+                                 '((1 . "one") (3 . "three") (4 . "four")))))
     (should (equal result '(1 . "one"))))
-  (let ((result (cl-assoc-if-not #'(lambda (x) (symbolp x)) '((1 . "one") (b . "bee") (2 . "two")))))
+  (let ((result (cl-assoc-if-not #'symbolp
+                                 '((1 . "one") (b . "bee") (2 . "two")))))
     (should (equal result '(1 . "one"))))
   (let ((result (cl-assoc-if-not #'cl-evenp '())))
     (should (equal result nil)))
-  (let ((result (cl-assoc-if-not #'(lambda (x) (eq x 'a)) '((a . "first") (a . "second") (b . "third")))))
+  (let ((result (cl-assoc-if-not (lambda (x) (eq x 'a))
+                                 '((a . "first") (a . "second") (b . "third")))))
     (should (equal result '(b . "third")))))
 
 (ert-deftest cl-rassoc-test ()
-  (let ((result (cl-rassoc 2 '(( "one" . 1) ("two" . 2) ("three" . 3)))))
-    (should (equal result (cons "two" 2))))
-  (let ((result (cl-rassoc 4 '(( "one" . 1) ("two" . 2) ("three" . 3)))))
+  (let ((result (cl-rassoc 2 '(("one" . 1) ("two" . 2) ("three" . 3)))))
+    (should (equal result '("two" . 2))))
+  (let ((result (cl-rassoc 4 '(("one" . 1) ("two" . 2) ("three" . 3)))))
     (should (equal result nil)))
-  (let ((result (cl-rassoc 2 '(( "one" . 1) ("two" . 2) ("baz" . 2)) :test 'equal)))
-    (should (equal result (cons "two" 2))))
-  (let ((result (cl-rassoc 2 '(( "one" . 1) ("two" . 2) ("three" . 3)) :test-not 'equal)))
-    (should (equal result (cons "one" 1))))
+  (let ((result (cl-rassoc 2 '(("one" . 1) ("two" . 2) ("baz" . 2))
+                           :test #'equal)))
+    (should (equal result '("two" . 2))))
+  (let ((result (cl-rassoc 2 '(("one" . 1) ("two" . 2) ("three" . 3))
+                           :test-not #'equal)))
+    (should (equal result '("one" . 1))))
   (let ((result (cl-rassoc 1 '())))
     (should (equal result nil)))
-  (let ((result (cl-rassoc 1 '(( "first" . 1) ("second" . 1) ("third" . 1)))))
-    (should (equal result (cons "first" 1))))
-  (let ((result (cl-rassoc 3 '(( "one" . 1) ("two" . 2) ("three" . 3)))))
-    (should (equal result (cons "three" 3))))
-  (let ((result (cl-rassoc 'found '((( "pair 1") . 1) ( "pair 2" . 2) ( "pair 3" . 3)))))
+  (let ((result (cl-rassoc 1 '(("first" . 1) ("second" . 1) ("third" . 1)))))
+    (should (equal result '("first" . 1))))
+  (let ((result (cl-rassoc 3 '(("one" . 1) ("two" . 2) ("three" . 3)))))
+    (should (equal result '("three" . 3))))
+  (let ((result (cl-rassoc 'found
+                           '((("pair 1") . 1) ("pair 2" . 2) ("pair 3" . 3)))))
     (should (equal result nil))))
 
 (ert-deftest cl-rassoc-if-test ()
-  (let ((result (cl-rassoc-if #'cl-evenp '(( "one" . 1) ("two" . 2) ("three" . 3)))))
+  (let ((result (cl-rassoc-if #'cl-evenp
+                              '(("one" . 1) ("two" . 2) ("three" . 3)))))
     (should (equal result '("two" . 2))))
-  (let ((result (cl-rassoc-if #'cl-evenp '(( "one" . 1) ("three" . 3) ("five" . 5)))))
+  (let ((result (cl-rassoc-if #'cl-evenp
+                              '(("one" . 1) ("three" . 3) ("five" . 5)))))
     (should (equal result nil)))
-  (let ((result (cl-rassoc-if #'(lambda (x) (= x 1)) '(( "one" . 1) ("two" . 2) ("three" . 3)))))
+  (let ((result (cl-rassoc-if (lambda (x) (= x 1))
+                              '(("one" . 1) ("two" . 2) ("three" . 3)))))
     (should (equal result '("one" . 1))))
-  (let ((result (cl-rassoc-if (lambda (x) (> x 1)) '(( "one" . 1) ("two" . 2) ("three" . 3)))))
+  (let ((result (cl-rassoc-if (lambda (x) (> x 1))
+                              '(("one" . 1) ("two" . 2) ("three" . 3)))))
     (should (equal result '("two" . 2))))
-  (let ((result (cl-rassoc-if #'(lambda (x) (and (numberp x) (< x 3))) '(( "one" . 1) ("two" . 2) ("three" . 3)))))
+  (let ((result (cl-rassoc-if (lambda (x) (and (numberp x) (< x 3)))
+                              '(("one" . 1) ("two" . 2) ("three" . 3)))))
     (should (equal result '("one" . 1))))
   (let ((result (cl-rassoc-if #'cl-evenp '())))
     (should (equal result nil)))
-  (let ((result (cl-rassoc-if #'(lambda (x) (> x 0)) '(( "first" . 1) ("second" . 2) ("third" . 3)))))
+  (let ((result (cl-rassoc-if #'cl-plusp
+                              '(("first" . 1) ("second" . 2) ("third" . 3)))))
     (should (equal result '("first" . 1))))
-  (let ((result (cl-rassoc-if #'(lambda (x) (string= (number-to-string x) "two")) '(( "one" . 1) ("two" . 2) ("three" . 3)))))
+  (let ((result (cl-rassoc-if (lambda (x) (string= (number-to-string x) "two"))
+                              '(("one" . 1) ("two" . 2) ("three" . 3)))))
     (should (equal result nil)))
-  (let ((result (cl-rassoc-if #'(lambda (x) (stringp x)) '(( "one" . 1) ("two" . 2) ("three" . 3)))))
+  (let ((result (cl-rassoc-if #'stringp
+                              '(("one" . 1) ("two" . 2) ("three" . 3)))))
     (should (equal result nil))))
 
 (ert-deftest cl-rassoc-if-not-test ()
-  (let ((result (cl-rassoc-if-not #'cl-evenp '(( "one" . 1) ("two" . 2) ("three" . 3)))))
+  (let ((result (cl-rassoc-if-not #'cl-evenp
+                                  '(("one" . 1) ("two" . 2) ("three" . 3)))))
     (should (equal result '("one" . 1))))
-  (let ((result (cl-rassoc-if-not #'(lambda (x) (> x 0)) '(( "one" . 1) ("two" . 2) ("three" . 3)))))
+  (let ((result (cl-rassoc-if-not #'cl-plusp
+                                  '(("one" . 1) ("two" . 2) ("three" . 3)))))
     (should (equal result nil)))
-  (let ((result (cl-rassoc-if-not #'(lambda (x) (< x 5)) '(( "one" . 1) ("two" . 2) ("six" . 6)))))
-    (should (equal result '( "six" . 6))))
-  (let ((result (cl-rassoc-if-not #'(lambda (x) (= x 1)) '(( "one" . 1) ("two" . 2) ("three" . 3)))))
+  (let ((result (cl-rassoc-if-not (lambda (x) (< x 5))
+                                  '(("one" . 1) ("two" . 2) ("six" . 6)))))
+    (should (equal result '("six" . 6))))
+  (let ((result (cl-rassoc-if-not (lambda (x) (= x 1))
+                                  '(("one" . 1) ("two" . 2) ("three" . 3)))))
     (should (equal result '("two" . 2))))
-  (let ((result (cl-rassoc-if-not #'(lambda (x) (> x 2)) '(( "one" . 1) ("two" . 1) ("three" . 3)))))
+  (let ((result (cl-rassoc-if-not (lambda (x) (> x 2))
+                                  '(("one" . 1) ("two" . 1) ("three" . 3)))))
     (should (equal result '("one" . 1))))
-  (let ((result (cl-rassoc-if-not #'(lambda (x) (and (numberp x) (< x 3))) '(( "one" . 1) ("two" . 2) ("three" . 3)))))
+  (let ((result (cl-rassoc-if-not (lambda (x) (and (numberp x) (< x 3)))
+                                  '(("one" . 1) ("two" . 2) ("three" . 3)))))
     (should (equal result '("three" . 3))))
-  (let ((result (cl-rassoc-if-not #'(lambda (x) (equal x 2)) '(( "one" . 1) ("two" . 2) ("three" . 3)))))
+  (let ((result (cl-rassoc-if-not (lambda (x) (equal x 2))
+                                  '(("one" . 1) ("two" . 2) ("three" . 3)))))
     (should (equal result '("one" . 1))))
   (let ((result (cl-rassoc-if-not #'cl-evenp '())))
     (should (equal result nil)))
-  (let ((result (cl-rassoc-if-not #'(lambda (x) (numberp x)) '(( "one" . 1) ("two" . 2) ("three" . 3)))))
+  (let ((result (cl-rassoc-if-not #'numberp
+                                  '(("one" . 1) ("two" . 2) ("three" . 3)))))
     (should (equal result nil)))
-  (let ((result (cl-rassoc-if-not (lambda (x) (and (listp x) (= (length x) 1))) '(((1 2) . 1) ((3 4) . 2) ((5) . 2)))))
+  (let ((result (cl-rassoc-if-not (lambda (x) (eql (proper-list-p x) 1))
+                                  '(((1 2) . 1) ((3 4) . 2) ((5) . 2)))))
     (should (equal result '((1 2) . 1)))))
 
 (ert-deftest cl-intersection-test ()
@@ -760,9 +785,9 @@ cl-intersection-test
     (should (equal result '(1 2 3))))
   (let ((result (cl-intersection '(1 1 2 3) '(1 2 2 3 4))))
     (should (equal result '(3 2 1 1))))
-  (let ((result (cl-intersection '(1 "two" 3) '(3 "two" 4))))
+  (let ((result (cl-intersection `(1 ,(copy-sequence "two") 3) '(3 "two" 4))))
     (should (equal result '(3))))
-  (let ((result (cl-intersection '(1 2 3) '(3 2 1) :test 'equal)))
+  (let ((result (cl-intersection '(1 2 3) '(3 2 1) :test #'equal)))
     (should (equal result '(1 2 3))))
   (let ((result (cl-intersection '(1 2 3) '(3 4 5) :key #'identity)))
     (should (equal result '(3))))
@@ -774,52 +799,20 @@ cl-intersection-test
     (should (equal result '(5 4 3)))))
 
 (ert-deftest cl-nintersection-test ()
-  (let ((list1 '(1 2 3 4))
-        (list2 '(3 4 5 6)))
-    (let ((result (cl-nintersection list1 list2)))
-      (should (equal result '(4 3)))
-      (should (equal list1 '(1 2 3 4)))
-      (should (equal list2 '(3 4 5 6)))))
-  (let ((list1 '(1 2))
-        (list2 '(3 4)))
-    (let ((result (cl-nintersection list1 list2)))
-      (should (equal result '()))
-      (should (equal list1 '(1 2)))
-      (should (equal list2 '(3 4)))))
-  (let ((list1 '(1 2 3))
-        (list2 '(1 2 3)))
-    (let ((result (cl-nintersection list1 list2)))
-      (should (equal result '(1 2 3)))
-      (should (equal list1 '(1 2 3)))
-      (should (equal list2 '(1 2 3)))))
-  (let ((list1 '(1 1 2 2 3))
-        (list2 '(2 2 3 4)))
-    (let ((result (cl-nintersection list1 list2)))
-      (should (equal result '(3 2 2)))
-      (should (equal list1 '(1 1 2 2 3)))
-      (should (equal list2 '(2 2 3 4)))))
-  (let ((list1 '(1 "two" 3))
-        (list2 '(3 "two" 4)))
-    (let ((result (cl-nintersection list1 list2)))
-      (should (equal result '(3)))
-      (should (equal list1 '(1 "two" 3)))
-      (should (equal list2 '(3 "two" 4)))))
-  (let ((list1 '(1 2 3))
-        (list2 '(3 2 1)))
-    (let ((result (cl-nintersection list1 list2 :test 'equal)))
-      (should (equal result '(1 2 3)))
-      (should (equal list1 '(1 2 3)))
-      (should (equal list2 '(3 2 1)))))
-  (let ((list1 '())
-        (list2 '(1 2 3)))
-    (let ((result (cl-nintersection list1 list2)))
-      (should (equal result '()))
-      (should (equal list1 '()))
-      (should (equal list2 '(1 2 3)))))
-  (let ((list1 '())
-        (list2 '()))
-    (let ((result (cl-nintersection list1 list2)))
-      (should (equal result '())))))
+  (should-not (cl-nintersection () ()))
+  (should-not (cl-nintersection () (list 1 2 3)))
+  (should-not (cl-nintersection (list 1 2) (list 3 4)))
+  (should (equal (cl-nintersection (list 1 2 3 4) (list 3 4 5 6))
+                 '(4 3)))
+  (should (equal (cl-nintersection (list 1 2 3) (list 1 2 3))
+                 '(1 2 3)))
+  (should (equal (cl-nintersection (list 1 1 2 2 3) (list 2 2 3 4))
+                 '(3 2 2)))
+  (should (equal (cl-nintersection (list 1 (copy-sequence "two") 3)
+                                   (list 3 "two" 4))
+                 '(3)))
+  (should (equal (cl-nintersection (list 1 2 3) (list 3 2 1) :test #'equal)
+                 '(1 2 3))))
 
 (ert-deftest cl-set-difference-test ()
   (let ((result (cl-set-difference '(1 2 3 4) '(3 4 5 6))))
@@ -832,11 +825,11 @@ cl-set-difference-test
     (should (equal result '(1 1 2))))
   (let ((result (cl-set-difference '(1 2 3) '(3 2 4))))
     (should (equal result '(1))))
-  (let ((result (cl-set-difference '(1 2 3) '(3 2 1) :test 'equal)))
+  (let ((result (cl-set-difference '(1 2 3) '(3 2 1) :test #'equal)))
     (should (equal result '())))
   (let ((result (cl-set-difference '((1 . "one") (2 . "two") (3 . "three"))
-                                    '((1 . "uno") (2 . "dos"))
-                                    :key 'car)))
+                                   '((1 . "uno") (2 . "dos"))
+                                   :key #'car)))
     (should (equal result '((3 . "three")))))
   (let ((result (cl-set-difference '() '(1 2 3))))
     (should (equal result '())))
@@ -844,65 +837,29 @@ cl-set-difference-test
     (should (equal result '(1 2 3))))
   (let ((result (cl-set-difference '(1 2 3 4 5) '(3 4 5 6 7))))
     (should (equal result '(1 2))))
-  (let ((list1 '(1 2 3))
-        (list2 '(2 3 4)))
-    (cl-set-difference list1 list2)
+  (let ((list1 (list 1 2 3))
+        (list2 (list 2 3 4)))
+    (should (equal (cl-set-difference list1 list2) '(1)))
     (should (equal list1 '(1 2 3)))
     (should (equal list2 '(2 3 4)))))
 
 (ert-deftest cl-nset-difference-test ()
-  (let ((list1 '(1 2 3 4))
-        (list2 '(3 4 5 6)))
-    (let ((result (cl-nset-difference list1 list2)))
-      (should (equal result '(1 2)))
-      (should (equal list1 '(1 2 3 4)))
-      (should (equal list2 '(3 4 5 6)))))
-  (let ((list1 '(1 2 3))
-        (list2 '()))
-    (let ((result (cl-nset-difference list1 list2)))
-      (should (equal result '(1 2 3)))
-      (should (equal list1 '(1 2 3)))
-      (should (equal list2 '()))))
-  (let ((list1 '(1 2 3))
-        (list2 '(1 2 3)))
-    (let ((result (cl-nset-difference list1 list2)))
-      (should (equal result '()))
-      (should (equal list1 '(1 2 3)))
-      (should (equal list2 '(1 2 3)))))
-  (let ((list1 '(1 1 2 2 3))
-        (list2 '(3 4 5)))
-    (let ((result (cl-nset-difference list1 list2)))
-      (should (equal result '(1 1 2 2)))
-      (should (equal list1 '(1 1 2 2 3)))
-      (should (equal list2 '(3 4 5)))))
-  (let ((list1 '(1 2 3))
-        (list2 '(3 2 4)))
-    (let ((result (cl-nset-difference list1 list2)))
-      (should (equal result '(1)))
-      (should (equal list1 '(1 2 3)))
-      (should (equal list2 '(3 2 4)))))
-  (let ((list1 '(1 2 3))
-        (list2 '(3 2 1)))
-    (let ((result (cl-nset-difference list1 list2 :test 'equal)))
-      (should (equal result '()))
-      (should (equal list1 '(1 2 3)))
-      (should (equal list2 '(3 2 1)))))
-  (let ((list1 '())
-          (list2 '(1 2 3)))
-      (let ((result (cl-nset-difference list1 list2)))
-        (should (equal result '()))
-        (should (equal list1 '()))
-        (should (equal list2 '(1 2 3)))))
-  (let ((list1 '())
-        (list2 '()))
-    (let ((result (cl-nset-difference list1 list2)))
-      (should (equal result '()))))
-  (let ((list1 '(1 2 3 4 5))
-        (list2 '(3 4 5 6 7)))
-    (let ((result (cl-nset-difference list1 list2)))
-      (should (equal result '(1 2)))
-      (should (equal list1 '(1 2 3 4 5)))
-      (should (equal list2 '(3 4 5 6 7))))))
+  (should-not (cl-nset-difference () ()))
+  (should-not (cl-nset-difference () (list 1 2 3)))
+  (should-not (cl-nset-difference (list 1 2 3) (list 1 2 3)))
+  (should-not (cl-nset-difference (list 1 2 3) (list 3 2 1) :test #'equal))
+  (should (equal (cl-nset-difference (list 1 2 3) ())
+                 '(1 2 3)))
+  (should (equal (cl-nset-difference (list 1 2 3 4) (list 3 4 5 6))
+                 '(1 2)))
+  (should (equal (cl-nset-difference (list 1 1 2 2 3) (list 3 4 5))
+                 '(1 1 2 2)))
+  (should (equal (cl-nset-difference (list 1 2 3) (list 3 2 4))
+                 '(1)))
+  (should (equal (cl-nset-difference (list 1 2 3 4 5) (list 3 4 5 6 7))
+                 '(1 2)))
+  (should (equal (cl-nset-difference (list 1 (copy-sequence "a")) (list 1 "a"))
+                 '("a"))))
 
 (ert-deftest cl-set-exclusive-or-test ()
   (let ((result (cl-set-exclusive-or '(1 2 3) '(3 4 5))))
@@ -919,104 +876,51 @@ cl-set-exclusive-or-test
     (should (equal result '(1 2 4 5))))
   (let ((result (cl-set-exclusive-or '(1 2 3) '(3 2 4))))
     (should (equal result '(1 4))))
-  (let ((result (cl-set-exclusive-or '(1 2 3) '(3 2 1) :test 'equal)))
+  (let ((result (cl-set-exclusive-or '(1 2 3) '(3 2 1) :test #'equal)))
     (should (equal result '())))
   (let ((result (cl-set-exclusive-or '() '())))
     (should (equal result '())))
-  (let ((result (cl-set-exclusive-or '(1 2 3 4 5) '(3 4 5 6 7)))
-        (list1 '(1 2 3 4 5))
-        (list2 '(3 4 5 6 7)))
-    (should (equal result '(1 2 6 7)))
+  (let ((list1 (list 1 2 3 4 5))
+        (list2 (list 3 4 5 6 7)))
+    (should (equal (cl-set-exclusive-or list1 list2) '(1 2 6 7)))
     (should (equal list1 '(1 2 3 4 5)))
     (should (equal list2 '(3 4 5 6 7)))))
 
 (ert-deftest cl-nset-exclusive-or-test ()
-  (let ((list1 '(1 2 3))
-        (list2 '(3 4 5)))
-    (let ((result (cl-nset-exclusive-or list1 list2)))
-      (should (equal result '(1 2 4 5)))
-      (should (equal list1 '(1 2 3)))
-      (should (equal list2 '(3 4 5)))))
-  (let ((list1 '(1 2 3))
-        (list2 '()))
-    (let ((result (cl-nset-exclusive-or list1 list2)))
-      (should (equal result '(1 2 3)))
-      (should (equal list1 '(1 2 3)))
-      (should (equal list2 '()))))
-  (let ((list1 '(1 2 3))
-        (list2 '(1 2 3)))
-    (let ((result (cl-nset-exclusive-or list1 list2)))
-      (should (equal result nil)))
-    (should (equal list1 '(1 2 3)))
-    (should (equal list2 '(1 2 3))))
-  (let ((list1 '(1 1 2 2 3))
-        (list2 '(3 4 5)))
-    (let ((result (cl-nset-exclusive-or list1 list2)))
-      (should (equal result '(1 1 2 2 4 5)))
-      (should (equal list1 '(1 1 2 2 3)))
-      (should (equal list2 '(3 4 5)))))
-  (let ((list1 '(1 2 3))
-        (list2 '(3 3 4 5)))
-    (let ((result (cl-nset-exclusive-or list1 list2)))
-      (should (equal result '(1 2 4 5)))
-      (should (equal list1 '(1 2 3)))
-      (should (equal list2 '(3 3 4 5)))))
-  (let ((list1 '(1 2 3))
-        (list2 '(3 2 4)))
-    (let ((result (cl-nset-exclusive-or list1 list2)))
-      (should (equal result '(1 4)))
-      (should (equal list1 '(1 2 3)))
-      (should (equal list2 '(3 2 4)))))
-  (let ((list1 '(1 2 3))
-        (list2 '(3 2 1)))
-    (let ((result (cl-nset-exclusive-or list1 list2 :test 'equal)))
-      (should (equal result '()))
-      (should (equal list1 '(1 2 3)))
-      (should (equal list2 '(3 2 1)))))
-  (let ((list1 '())
-        (list2 '(1 2 3)))
-    (let ((result (cl-nset-exclusive-or list1 list2)))
-      (should (equal result '(1 2 3)))
-      (should (equal list1 '()))
-      (should (equal list2 '(1 2 3)))))
-  (let ((list1 '())
-        (list2 '()))
-    (let ((result (cl-nset-exclusive-or list1 list2)))
-      (should (equal result '()))))
-  (let ((list1 '(1 2 3 4 5))
-        (list2 '(3 4 5 6 7)))
-    (let ((result (cl-nset-exclusive-or list1 list2)))
-      (should (equal result '(1 2 6 7)))
-      (should (equal list1 '(1 2 3 4 5)))
-      (should (equal list2 '(3 4 5 6 7))))))
+  (should-not (cl-nset-exclusive-or () ()))
+  (should-not (cl-nset-exclusive-or (list 1 2 3) (list 1 2 3)))
+  (should-not (cl-nset-exclusive-or (list 1 2 3) (list 3 2 1) :test #'equal))
+  (should (equal (cl-nset-exclusive-or (list 1 2 3) (list 3 4 5))
+                 '(1 2 4 5)))
+  (should (equal (cl-nset-exclusive-or (list 1 2 3) ())
+                 '(1 2 3)))
+  (should (equal (cl-nset-exclusive-or (list 1 1 2 2 3) (list 3 4 5))
+                 '(1 1 2 2 4 5)))
+  (should (equal (cl-nset-exclusive-or (list 1 2 3) (list 3 3 4 5))
+                 '(1 2 4 5)))
+  (should (equal (cl-nset-exclusive-or (list 1 2 3) (list 3 2 4))
+                 '(1 4)))
+  (should (equal (cl-nset-exclusive-or () (list 1 2 3))
+                 '(1 2 3)))
+  (should (equal (cl-nset-exclusive-or (list 1 2 3 4 5) (list 3 4 5 6 7))
+                 '(1 2 6 7))))
 
 (ert-deftest cl-subsetp-test ()
-  (let ((result (cl-subsetp '(1 2) '(1 2 3 4))))
-    (should (equal result t)))
-  (let ((result (cl-subsetp '() '(1 2 3 4))))
-    (should (equal result t)))
-  (let ((result (cl-subsetp '(1 2) '())))
-    (should (equal result nil)))
-  (let ((result (cl-subsetp '(1 2 3) '(1 2 3))))
-    (should (equal result t)))
-  (let ((result (cl-subsetp '(1 1 2) '(1 2 3))))
-    (should (equal result t)))
-  (let ((result (cl-subsetp '(1 2) '(1 1 2 3 4))))
-    (should (equal result t)))
-  (let ((result (cl-subsetp '(1 "two" 3) '(3 "two" 1))))
-    (should (equal result nil)))
-  (let ((result (cl-subsetp '(1 2) '(2 1) :test 'equal)))
-    (should (equal result t)))
-  (let ((result (cl-subsetp '((1 . "one") (2 . "two")) '((1 . "uno") (2 . "dos")) :key 'car)))
-    (should (equal result t)))
-  (let ((result (cl-subsetp '(1 2) '(3 4 2 1) :test 'eq)))
-    (should (equal result t)))
-  (let ((result (cl-subsetp '((1 2) (3)) '((1 2 . "found") (3 . "found")) :key 'car)))
-    (should (equal result t)))
-  (let ((result (cl-subsetp '(1 2) '(1 2 3 2))))
-    (should (equal result t)))
-  (let ((result (cl-subsetp '() '())))
-    (should (equal result t))))
+  (should (cl-subsetp '(1 2) '(1 2 3 4)))
+  (should (cl-subsetp () '(1 2 3 4)))
+  (should-not (cl-subsetp '(1 2) ()))
+  (should (cl-subsetp '(1 2 3) '(1 2 3)))
+  (should (cl-subsetp '(1 1 2) '(1 2 3)))
+  (should (cl-subsetp '(1 2) '(1 1 2 3 4)))
+  (should-not (cl-subsetp '(1 "two" 3) '(3 "two" 1)))
+  (should (cl-subsetp '(1 2) '(2 1) :test #'equal))
+  (should (cl-subsetp '((1 . "one") (2 . "two"))
+                      '((1 . "uno") (2 . "dos"))
+                      :key #'car))
+  (should (cl-subsetp '(1 2) '(3 4 2 1) :test #'eq))
+  (should (cl-subsetp '((1 2) (3)) '((1 2 . "found") (3 . "found")) :key #'car))
+  (should (cl-subsetp '(1 2) '(1 2 3 2)))
+  (should (cl-subsetp () ())))
 
 (provide 'cl-seq-tests)
 ;;; cl-seq-tests.el ends here
-- 
2.45.2