diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/so-long-tests/so-long-tests.el | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/test/lisp/so-long-tests/so-long-tests.el b/test/lisp/so-long-tests/so-long-tests.el index 99af5e91ba0..ae834421667 100644 --- a/test/lisp/so-long-tests/so-long-tests.el +++ b/test/lisp/so-long-tests/so-long-tests.el | |||
| @@ -259,26 +259,24 @@ | |||
| 259 | (so-long-tests-assert-and-revert (or action 'so-long-mode))))) | 259 | (so-long-tests-assert-and-revert (or action 'so-long-mode))))) |
| 260 | 260 | ||
| 261 | (ert-deftest so-long-tests-so-long-menu-item-replace-action () | 261 | (ert-deftest so-long-tests-so-long-menu-item-replace-action () |
| 262 | "Test using the `so-long-menu-item-replace-action' menu item." | 262 | "Test using the `so-long-menu' action commands." |
| 263 | (with-temp-buffer | 263 | (with-temp-buffer |
| 264 | ;; Due to (with-selected-window (so-long-menu-click-window) ...) | ||
| 265 | ;; (used by `so-long-menu-item-replace-action'), our temp buffer | ||
| 266 | ;; must be in the selected window. | ||
| 267 | (set-window-buffer nil (current-buffer)) | ||
| 268 | (insert "#!emacs\n") | 264 | (insert "#!emacs\n") |
| 269 | (normal-mode) | 265 | (normal-mode) |
| 270 | (so-long-tests-remember) | 266 | (so-long-tests-remember) |
| 271 | (insert (make-string (1+ so-long-threshold) ?x)) | 267 | (insert (make-string (1+ so-long-threshold) ?x)) |
| 272 | (let (action) | 268 | (let ((menu (so-long-menu)) |
| 269 | action | ||
| 270 | command) | ||
| 273 | (dolist (item so-long-action-alist) | 271 | (dolist (item so-long-action-alist) |
| 274 | ;; n.b. Any existing action is first reverted. | 272 | (setq action (car item) |
| 275 | (so-long-menu-item-replace-action item) | 273 | command (lookup-key menu (vector action))) |
| 276 | (setq action (car item)) | 274 | (funcall command) |
| 277 | (so-long-tests-assert-active action)) | 275 | (so-long-tests-assert-active action)) |
| 278 | ;; After all actions have been used, revert to normal and assert | 276 | ;; After all actions have been used, revert to normal and assert |
| 279 | ;; that the most recent action to have been applied is the one | 277 | ;; that the most recent action to have been applied is the one |
| 280 | ;; we have just reverted. | 278 | ;; we have just reverted. |
| 281 | (so-long-menu-item-revert) | 279 | (funcall (lookup-key menu [so-long-revert])) |
| 282 | (so-long-tests-assert-reverted action)))) | 280 | (so-long-tests-assert-reverted action)))) |
| 283 | 281 | ||
| 284 | (ert-deftest so-long-tests-major-mode () | 282 | (ert-deftest so-long-tests-major-mode () |