diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/autorevert-tests.el | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el index 8f375b63a69..05d24b51ee7 100644 --- a/test/lisp/autorevert-tests.el +++ b/test/lisp/autorevert-tests.el | |||
| @@ -161,7 +161,7 @@ This expects `auto-revert--messages' to be bound by | |||
| 161 | :tags '(:expensive-test) | 161 | :tags '(:expensive-test) |
| 162 | 162 | ||
| 163 | (let ((tmpfile (make-temp-file "auto-revert-test")) | 163 | (let ((tmpfile (make-temp-file "auto-revert-test")) |
| 164 | buf) | 164 | buf desc) |
| 165 | (unwind-protect | 165 | (unwind-protect |
| 166 | (progn | 166 | (progn |
| 167 | (write-region "any text" nil tmpfile nil 'no-message) | 167 | (write-region "any text" nil tmpfile nil 'no-message) |
| @@ -174,6 +174,7 @@ This expects `auto-revert--messages' to be bound by | |||
| 174 | (sleep-for 1) | 174 | (sleep-for 1) |
| 175 | (auto-revert-mode 1) | 175 | (auto-revert-mode 1) |
| 176 | (should auto-revert-mode) | 176 | (should auto-revert-mode) |
| 177 | (setq desc auto-revert-notify-watch-descriptor) | ||
| 177 | 178 | ||
| 178 | ;; Remove file while reverting. We simulate this by | 179 | ;; Remove file while reverting. We simulate this by |
| 179 | ;; modifying `before-revert-hook'. | 180 | ;; modifying `before-revert-hook'. |
| @@ -192,7 +193,7 @@ This expects `auto-revert--messages' to be bound by | |||
| 192 | (should (string-match "any text" (buffer-string))) | 193 | (should (string-match "any text" (buffer-string))) |
| 193 | ;; With w32notify, the 'stopped' events are not sent. | 194 | ;; With w32notify, the 'stopped' events are not sent. |
| 194 | (or (eq file-notify--library 'w32notify) | 195 | (or (eq file-notify--library 'w32notify) |
| 195 | (should-not auto-revert-use-notify)) | 196 | (should-not auto-revert-notify-watch-descriptor)) |
| 196 | 197 | ||
| 197 | ;; Once the file has been recreated, the buffer shall be | 198 | ;; Once the file has been recreated, the buffer shall be |
| 198 | ;; reverted. | 199 | ;; reverted. |
| @@ -203,6 +204,11 @@ This expects `auto-revert--messages' to be bound by | |||
| 203 | (auto-revert--wait-for-revert buf)) | 204 | (auto-revert--wait-for-revert buf)) |
| 204 | ;; Check, that the buffer has been reverted. | 205 | ;; Check, that the buffer has been reverted. |
| 205 | (should (string-match "another text" (buffer-string))) | 206 | (should (string-match "another text" (buffer-string))) |
| 207 | ;; When file notification is used, it must be reenabled | ||
| 208 | ;; after recreation of the file. We cannot expect that | ||
| 209 | ;; the descriptor is the same, so we just check the | ||
| 210 | ;; existence. | ||
| 211 | (should (eq (null desc) (null auto-revert-notify-watch-descriptor))) | ||
| 206 | 212 | ||
| 207 | ;; An empty file shall still be reverted. | 213 | ;; An empty file shall still be reverted. |
| 208 | (ert-with-message-capture auto-revert--messages | 214 | (ert-with-message-capture auto-revert--messages |