From: Stephen Berman Date: Mon, 2 Dec 2024 12:13:39 +0000 (+0100) Subject: Fix latest test for dabbrev-expand X-Git-Tag: archive/raspbian/1%30.1+1-3+rpi1^2~2^2~20^2~230 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6bca138d60e47d0fbab4faf8e83c5b9b319f260d;p=emacs.git Fix latest test for dabbrev-expand * test/lisp/dabbrev-tests.el (dabbrev-expand-after-killing-buffer): Fix typo in a 'should' test, use part of return value of 'should-error' test, and remove mistaken and unfounded FIXME comment. --- diff --git a/test/lisp/dabbrev-tests.el b/test/lisp/dabbrev-tests.el index b5737373875..3e84024698f 100644 --- a/test/lisp/dabbrev-tests.el +++ b/test/lisp/dabbrev-tests.el @@ -278,12 +278,8 @@ minibuffer was entered, the replacement should found in another buffer." (ert-deftest dabbrev-expand-after-killing-buffer () "Test expansion after killing buffer containing first expansion. Finding successive expansions in another live buffer should succeed, but -after killing the buffer, expansion should fail with a user-error." - ;; FIXME? The message shown by the user-error is in *Messages* but - ;; since the test finishes on hitting the user-error, we cannot test - ;; further, either for the content of the message or the content of - ;; the current buffer, so apparently cannot reproduce what a user - ;; entering these commands manually sees. +after killing the buffer, expansion should fail with a user-error, +leaving the unexpanded string in the buffer." ; See bug#74090. (with-dabbrev-test (with-current-buffer (get-buffer-create "foo") (insert "abc abd")) @@ -298,13 +294,9 @@ after killing the buffer, expansion should fail with a user-error." (should (string= (buffer-string) "abc abd")) (kill-buffer "foo") (erase-buffer) - (should-error (execute-kbd-macro (kbd "abc SPC ab M-/ M-/")) - :type 'user-error) - ;; (should (string= (buffer-string) "abc abc")) - ;; (with-current-buffer "*Messages*" - ;; (goto-char (point-max)) - ;; (should (string= (buffer-substring (pos-bol) (pos-eol)) - ;; "No further dynamic expansion for ‘ab’ found"))) - )) + (let ((msg (cadr (should-error (execute-kbd-macro (kbd "abc SPC ab M-/ M-/")) + :type 'user-error)))) + (should (string= (buffer-string) "abc ab")) + (should (string= msg "No further dynamic expansion for ‘ab’ found"))))) ;;; dabbrev-tests.el ends here