From: Basil L. Contovounesios Date: Sun, 2 Feb 2025 16:24:14 +0000 (+0100) Subject: Fix uncaught cl-nreconc on constant list X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=73d6c4b91e8547bef9d4f168a8425fe2a202f4a3;p=emacs.git Fix uncaught cl-nreconc on constant list * test/lisp/emacs-lisp/cl-extra-tests.el (cl-extra-test-isqrt): Expect most specific error type. (cl-extra-test-nreconc): Pass fresh list as first argument to cl-nreconc. The usual mutates-arguments warning was not emitted, possibly in relation to bug#74920 and cl-nreconc being proclaimed inline. (cl-extra-test-list-length): Simplify using nconc. (cherry picked from commit b8c8ae92dba223960b54b5b6e18cce4a11bbf870) --- diff --git a/test/lisp/emacs-lisp/cl-extra-tests.el b/test/lisp/emacs-lisp/cl-extra-tests.el index e2a0276ae0a..bec4e373201 100644 --- a/test/lisp/emacs-lisp/cl-extra-tests.el +++ b/test/lisp/emacs-lisp/cl-extra-tests.el @@ -220,8 +220,8 @@ (should (equal (cl-isqrt 0) 0)) (should (equal (cl-isqrt 3) 1)) (should (equal (cl-isqrt 10) 3)) - (should-error (cl-isqrt -4)) - (should-error (cl-isqrt 2.5))) + (should-error (cl-isqrt -4) :type 'arith-error) + (should-error (cl-isqrt 2.5) :type 'arith-error)) (ert-deftest cl-extra-test-floor () (should (equal (cl-floor 4.5) '(4 0.5))) @@ -282,13 +282,13 @@ (should (equal (cl-revappend '(1 2 3) '(4 5 6)) '(3 2 1 4 5 6)))) (ert-deftest cl-extra-test-nreconc () - (should (equal (cl-nreconc '(1 2 3) '(4 5 6)) '(3 2 1 4 5 6)))) + (should (equal (cl-nreconc (list 1 2 3) '(4 5 6)) '(3 2 1 4 5 6)))) (ert-deftest cl-extra-test-list-length () (should (equal (cl-list-length '(1 2 3)) 3)) (should (equal (cl-list-length '()) 0)) (let ((xl (number-sequence 1 100))) - (setcdr (nthcdr 99 xl) xl) + (nconc xl xl) (should (equal (cl-list-length xl) nil)))) (ert-deftest cl-extra-test-tailp ()