1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Don't assume that literal constants are eq-unique in tests

* test/lisp/emacs-lisp/cl-lib-tests.el (cl-test-ldiff):
* test/lisp/emacs-lisp/seq-tests.el (test-seq-union):
These tests relied on literal constants being unique in the sense of
'eq', and would fail if they stop being that (already the case for
strings).
This commit is contained in:
Mattias Engdegård 2025-11-02 18:11:34 +01:00
parent f591d1c027
commit d123ac1400
2 changed files with 3 additions and 3 deletions

View file

@ -208,7 +208,7 @@
(should (null (cl-ldiff l l)))
(should (equal l (cl-ldiff l '())))
;; must be part of the list
(should (equal l (cl-ldiff l '(2 3))))
(should (equal l (cl-ldiff l (list 2 3))))
(should (equal '(1) (cl-ldiff l (nthcdr 1 l))))
;; should return a copy
(should-not (eq (cl-ldiff l '()) l))))

View file

@ -386,8 +386,8 @@ Evaluate BODY for each created sequence.
(should (same-contents-p (seq-union v1 v2)
'("a" "b" "c" "f" "e"))))
(let ((v1 '("a"))
(v2 '("a"))
(let ((v1 (list (make-string 1 ?a)))
(v2 (list (make-string 1 ?a)))
(testfn #'eq))
(should (same-contents-p (seq-union v1 v2 testfn)
'("a" "a")))))