diff options
author | Matt Armstrong <matt@rfc20.org> | 2022-11-15 10:33:00 -0800 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2022-11-16 16:34:31 +0200 |
commit | aee4d67b097910a13cf371e96f697a966a4c0869 (patch) | |
tree | 1b02bd9d49f85b1466d06fc8a1f58054e34aba0e /test/src | |
parent | 4cf97969e6bb6f47c5b6ad4ca2afc2370abd6212 (diff) | |
download | emacs-aee4d67b097910a13cf371e96f697a966a4c0869.tar.gz emacs-aee4d67b097910a13cf371e96f697a966a4c0869.tar.bz2 emacs-aee4d67b097910a13cf371e96f697a966a4c0869.zip |
Reduce buffer-tests noisiness when run in batch mode.
* test/src/buffer-tests.el (overlay-modification-hooks): Remove noisy
`message' calls and use `ert-info' to log context of test
failures. (bug#59028)
(overlay-tests-start-recording-modification-hooks): ditto.
Diffstat (limited to 'test/src')
-rw-r--r-- | test/src/buffer-tests.el | 77 |
1 files changed, 35 insertions, 42 deletions
diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el index 3fc52eaf8b6..2b6c974159b 100644 --- a/test/src/buffer-tests.el +++ b/test/src/buffer-tests.el @@ -42,7 +42,6 @@ recorded calls conveniently." overlay hooks-property (list (lambda (ov &rest args) - (message " %S called on %S with args %S" hooks-property ov args) (should inhibit-modification-hooks) (should (eq ov overlay)) (push (list hooks-property args) @@ -175,47 +174,41 @@ properties." (t 1 2 0)) (insert-behind-hooks (t 1 2 0))))))) - (message "BEGIN overlay-modification-hooks test-case %S" test-case) - - ;; All three hooks ignore the overlay's `front-advance' and - ;; `rear-advance' option, so test both ways while expecting the same - ;; result. - (dolist (advance '(nil t)) - (message " advance is %S" advance) - (let-alist test-case - (with-temp-buffer - ;; Set up the temporary buffer and overlay as specified by - ;; the test case. - (insert (or .buffer-text "1234")) - (let ((overlay (make-overlay - (or .overlay-beg 2) - (or .overlay-end 4) - nil - advance advance))) - (message " (buffer-string) is %S" (buffer-string)) - (message " overlay is %S" overlay) - (overlay-tests-start-recording-modification-hooks overlay) - - ;; Modify the buffer, possibly inducing calls to the - ;; overlay's modification hooks. - (should (or .insert-at .replace)) - (when .insert-at - (goto-char .insert-at) - (insert "x") - (message " inserted \"x\" at %S, buffer-string now %S" - .insert-at (buffer-string))) - (when .replace - (goto-char (point-min)) - (search-forward .replace) - (replace-match "x") - (message " replaced %S with \"x\"" .replace)) - - ;; Verify that the expected and actual modification hook - ;; calls match. - (should (equal - .expected-calls - (overlay-tests-get-recorded-modification-hooks - overlay))))))))) + (ert-info ((format "test-case: %S" test-case)) + ;; All three hooks ignore the overlay's `front-advance' and + ;; `rear-advance' option, so test both ways while expecting the same + ;; result. + (dolist (advance '(nil t)) + (ert-info ((format "advance is %S" advance)) + (let-alist test-case + (with-temp-buffer + ;; Set up the temporary buffer and overlay as specified by + ;; the test case. + (insert (or .buffer-text "1234")) + (let ((overlay (make-overlay + (or .overlay-beg 2) + (or .overlay-end 4) + nil + advance advance))) + (overlay-tests-start-recording-modification-hooks overlay) + + ;; Modify the buffer, possibly inducing calls to the + ;; overlay's modification hooks. + (should (or .insert-at .replace)) + (when .insert-at + (goto-char .insert-at) + (insert "x")) + (when .replace + (goto-char (point-min)) + (search-forward .replace) + (replace-match "x")) + + ;; Verify that the expected and actual modification hook + ;; calls match. + (should (equal + .expected-calls + (overlay-tests-get-recorded-modification-hooks + overlay))))))))))) (ert-deftest overlay-modification-hooks-message-other-buf () "Test for bug#21824. |