mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
pp.el: Try and fix bug#70039
* lisp/emacs-lisp/pp.el (pp-fill): Avoid splitting `#N#` or `#[`. * test/lisp/emacs-lisp/pp-tests.el (pp-tests--sanity): New test.
This commit is contained in:
parent
de9e913f9e
commit
4cee95815b
2 changed files with 36 additions and 10 deletions
|
|
@ -66,4 +66,23 @@
|
|||
(while (search-forward "." nil t)
|
||||
(should (not (eolp))))))
|
||||
|
||||
(ert-deftest pp-tests--sanity ()
|
||||
(with-temp-buffer
|
||||
(lisp-data-mode)
|
||||
(let ((testdata "(a b c #1=#[0 \"\" [] 0] #s(foo #1# bar))"))
|
||||
(let ((res (car (read-from-string testdata))))
|
||||
(dotimes (i (length testdata))
|
||||
(erase-buffer)
|
||||
(insert testdata)
|
||||
(let ((fill-column i))
|
||||
(pp-fill (point-min) (point-max))
|
||||
(goto-char (point-min))
|
||||
(condition-case err
|
||||
(should (equal (read (current-buffer)) res))
|
||||
(invalid-read-syntax
|
||||
(message "Invalid fill result with i=%d:\n%s"
|
||||
i (buffer-string))
|
||||
(signal (car err) (cdr err))
|
||||
))))))))
|
||||
|
||||
;;; pp-tests.el ends here.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue