From d123ac14005dcabe2e83630ae17b678f2c113d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= Date: Sun, 2 Nov 2025 18:11:34 +0100 Subject: [PATCH] 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). --- test/lisp/emacs-lisp/cl-lib-tests.el | 2 +- test/lisp/emacs-lisp/seq-tests.el | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/lisp/emacs-lisp/cl-lib-tests.el b/test/lisp/emacs-lisp/cl-lib-tests.el index d7c38b73432..2955e3f9c88 100644 --- a/test/lisp/emacs-lisp/cl-lib-tests.el +++ b/test/lisp/emacs-lisp/cl-lib-tests.el @@ -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)))) diff --git a/test/lisp/emacs-lisp/seq-tests.el b/test/lisp/emacs-lisp/seq-tests.el index a8ed51e8e70..e84e50dda4c 100644 --- a/test/lisp/emacs-lisp/seq-tests.el +++ b/test/lisp/emacs-lisp/seq-tests.el @@ -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")))))