aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorPip Cet2025-06-28 09:33:01 +0000
committerPip Cet2025-06-28 10:46:08 +0000
commit6b19eb53c5048cfec1f3601afb44f94ebbb9d138 (patch)
tree201e5d624f38626ef24e26fb243b644656e585b7 /test/src
parentc64b2bf113eaa2044c24860d0610c3b8ebd7e742 (diff)
downloademacs-6b19eb53c5048cfec1f3601afb44f94ebbb9d138.tar.gz
emacs-6b19eb53c5048cfec1f3601afb44f94ebbb9d138.zip
Avoid extra output in Vprin1_to_string_buffer (bug#78842)
print_error_message can throw after producing some output, so use unwind-protect to ensure prin1-to-string-buffer is cleared. * src/print.c (erase_prin1_to_string_buffer): New. (Ferror_message_string): Use it to catch errors thrown in 'print_error_message'. * test/src/print-tests.el (error-message-string-circular): Expand test.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/print-tests.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/src/print-tests.el b/test/src/print-tests.el
index 036248fd091..ce8c095d496 100644
--- a/test/src/print-tests.el
+++ b/test/src/print-tests.el
@@ -356,7 +356,9 @@ otherwise, use a different charset."
356(print-tests--deftest error-message-string-circular () 356(print-tests--deftest error-message-string-circular ()
357 (let ((err (list 'error))) 357 (let ((err (list 'error)))
358 (setcdr err err) 358 (setcdr err err)
359 (should-error (error-message-string err) :type 'circular-list))) 359 (should-error (error-message-string err) :type 'circular-list)
360 ;; check that prin1-to-string-buffer is cleared (bug#78842)
361 (should (equal "37.0" (prin1-to-string 37.0)))))
360 362
361(print-tests--deftest print-hash-table-test () 363(print-tests--deftest print-hash-table-test ()
362 (should 364 (should