diff options
| author | Yuan Fu | 2024-12-01 17:52:16 -0800 |
|---|---|---|
| committer | Yuan Fu | 2024-12-01 17:52:16 -0800 |
| commit | 4afd1eca3662eda052d0017f83b4baa1f6131e8b (patch) | |
| tree | 10c2a2f0d338b8fb330fbbc9b21f296271b73ee2 /test | |
| parent | 676ff9fd7c083598b2955a463774283768d8e209 (diff) | |
| parent | cf4f1387a6561be7cd7387b766df4386a0fa472f (diff) | |
| download | emacs-4afd1eca3662eda052d0017f83b4baa1f6131e8b.tar.gz emacs-4afd1eca3662eda052d0017f83b4baa1f6131e8b.zip | |
Merge from emacs-30
cf4f1387a65 ; Update tree-sitter manual
3c7687c1dd1 Allow passing nil to treesit-node-match-p (bug#74612)
748b19e56e8 Update to version 2.58 of librsvg API (bug#74606)
4c67f636c08 Fix decoding of non-ASCII email attachments
bd8a6f70fb9 Prevent "Selecting deleted buffer" error with dabbrev-expand
0a753603a53 ; (dictionary-search-interface): Fix bug#74511.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/dabbrev-tests.el | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/test/lisp/dabbrev-tests.el b/test/lisp/dabbrev-tests.el index 987106aa5af..b5737373875 100644 --- a/test/lisp/dabbrev-tests.el +++ b/test/lisp/dabbrev-tests.el | |||
| @@ -238,7 +238,7 @@ entered." | |||
| 238 | ;; FIXME: Why is dabbrev--reset-global-variables needed here? | 238 | ;; FIXME: Why is dabbrev--reset-global-variables needed here? |
| 239 | (ert-deftest dabbrev-expand-test-minibuffer-3 () | 239 | (ert-deftest dabbrev-expand-test-minibuffer-3 () |
| 240 | "Test replacing an expansion in the minibuffer using two buffers. | 240 | "Test replacing an expansion in the minibuffer using two buffers. |
| 241 | The first expansion should befound in the buffer from which the | 241 | The first expansion should be found in the buffer from which the |
| 242 | minibuffer was entered, the replacement should found in another buffer." | 242 | minibuffer was entered, the replacement should found in another buffer." |
| 243 | (with-dabbrev-test | 243 | (with-dabbrev-test |
| 244 | (find-file (ert-resource-file "INSTALL_BEGIN")) | 244 | (find-file (ert-resource-file "INSTALL_BEGIN")) |
| @@ -275,4 +275,36 @@ minibuffer was entered, the replacement should found in another buffer." | |||
| 275 | (should (string= (minibuffer-contents) "Indic and")) | 275 | (should (string= (minibuffer-contents) "Indic and")) |
| 276 | (delete-minibuffer-contents)))) | 276 | (delete-minibuffer-contents)))) |
| 277 | 277 | ||
| 278 | (ert-deftest dabbrev-expand-after-killing-buffer () | ||
| 279 | "Test expansion after killing buffer containing first expansion. | ||
| 280 | Finding successive expansions in another live buffer should succeed, but | ||
| 281 | after killing the buffer, expansion should fail with a user-error." | ||
| 282 | ;; FIXME? The message shown by the user-error is in *Messages* but | ||
| 283 | ;; since the test finishes on hitting the user-error, we cannot test | ||
| 284 | ;; further, either for the content of the message or the content of | ||
| 285 | ;; the current buffer, so apparently cannot reproduce what a user | ||
| 286 | ;; entering these commands manually sees. | ||
| 287 | (with-dabbrev-test | ||
| 288 | (with-current-buffer (get-buffer-create "foo") | ||
| 289 | (insert "abc abd")) | ||
| 290 | (switch-to-buffer "*scratch*") | ||
| 291 | (erase-buffer) | ||
| 292 | (execute-kbd-macro (kbd "ab M-/")) | ||
| 293 | (should (string= (buffer-string) "abc")) | ||
| 294 | (execute-kbd-macro (kbd "SPC ab M-/")) | ||
| 295 | (should (string= (buffer-string) "abc abc")) | ||
| 296 | (erase-buffer) | ||
| 297 | (execute-kbd-macro (kbd "abc SPC ab M-/ M-/")) | ||
| 298 | (should (string= (buffer-string) "abc abd")) | ||
| 299 | (kill-buffer "foo") | ||
| 300 | (erase-buffer) | ||
| 301 | (should-error (execute-kbd-macro (kbd "abc SPC ab M-/ M-/")) | ||
| 302 | :type 'user-error) | ||
| 303 | ;; (should (string= (buffer-string) "abc abc")) | ||
| 304 | ;; (with-current-buffer "*Messages*" | ||
| 305 | ;; (goto-char (point-max)) | ||
| 306 | ;; (should (string= (buffer-substring (pos-bol) (pos-eol)) | ||
| 307 | ;; "No further dynamic expansion for ‘ab’ found"))) | ||
| 308 | )) | ||
| 309 | |||
| 278 | ;;; dabbrev-tests.el ends here | 310 | ;;; dabbrev-tests.el ends here |