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.
This commit is contained in:
Stephen Berman 2024-12-02 13:13:39 +01:00
parent cf4f1387a6
commit 6bca138d60

View file

@ -278,12 +278,8 @@ minibuffer was entered, the replacement should found in another buffer."
(ert-deftest dabbrev-expand-after-killing-buffer () (ert-deftest dabbrev-expand-after-killing-buffer ()
"Test expansion after killing buffer containing first expansion. "Test expansion after killing buffer containing first expansion.
Finding successive expansions in another live buffer should succeed, but Finding successive expansions in another live buffer should succeed, but
after killing the buffer, expansion should fail with a user-error." after killing the buffer, expansion should fail with a user-error,
;; FIXME? The message shown by the user-error is in *Messages* but leaving the unexpanded string in the buffer." ; See bug#74090.
;; 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.
(with-dabbrev-test (with-dabbrev-test
(with-current-buffer (get-buffer-create "foo") (with-current-buffer (get-buffer-create "foo")
(insert "abc abd")) (insert "abc abd"))
@ -298,13 +294,9 @@ after killing the buffer, expansion should fail with a user-error."
(should (string= (buffer-string) "abc abd")) (should (string= (buffer-string) "abc abd"))
(kill-buffer "foo") (kill-buffer "foo")
(erase-buffer) (erase-buffer)
(should-error (execute-kbd-macro (kbd "abc SPC ab M-/ M-/")) (let ((msg (cadr (should-error (execute-kbd-macro (kbd "abc SPC ab M-/ M-/"))
:type 'user-error) :type 'user-error))))
;; (should (string= (buffer-string) "abc abc")) (should (string= (buffer-string) "abc ab"))
;; (with-current-buffer "*Messages*" (should (string= msg "No further dynamic expansion for ab found")))))
;; (goto-char (point-max))
;; (should (string= (buffer-substring (pos-bol) (pos-eol))
;; "No further dynamic expansion for ab found")))
))
;;; dabbrev-tests.el ends here ;;; dabbrev-tests.el ends here