mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
Fix cl-print for circular sublists (Bug#31146)
* lisp/emacs-lisp/cl-print.el (cl-print-object) <cons>: Push each element of list being printed onto cl-print--currently-printing. * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-circle-2): New test.
This commit is contained in:
parent
a92e7b4ef6
commit
b8aa7ecf54
2 changed files with 16 additions and 3 deletions
|
|
@ -55,4 +55,14 @@
|
|||
(let ((print-circle t))
|
||||
(should (equal "(#1=(a . #1#) #1#)" (cl-prin1-to-string x))))))
|
||||
|
||||
(ert-deftest cl-print-circle-2 ()
|
||||
;; Bug#31146.
|
||||
(let ((x '(0 . #1=(0 . #1#))))
|
||||
(let ((print-circle nil))
|
||||
(should (string-match "\\`(0 0 . #[0-9])\\'"
|
||||
(cl-prin1-to-string x))))
|
||||
(let ((print-circle t))
|
||||
(should (equal "(0 . #1=(0 . #1#))" (cl-prin1-to-string x))))))
|
||||
|
||||
|
||||
;;; cl-print-tests.el ends here.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue