summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2015-09-14 22:15:20 +0200
committerMichael Albinus <michael.albinus@gmx.de>2015-09-14 22:15:20 +0200
commit67ddc7c55d6b40e3d37b2773e002a50123ae7411 (patch)
tree98e4f30f14cc1d0588a7f4b7fbee4e38055f9fca /test
parent1ee47d477ddb9c567eaf63154f78fad5d5826b78 (diff)
downloademacs-67ddc7c55d6b40e3d37b2773e002a50123ae7411.tar.gz
Adaot file-notify-tests.el test cases
* lisp/filenotify.el (file-notify-rm-watch): Ignore `file-notify-error'. * src/inotify.c (Finotify_valid_p): Adapt docstring. * test/automated/file-notify-tests.el () (file-notify-test03-autorevert) (file-notify-test04-file-validity) (file-notify-test04-file-validity-remote) (file-notify-test05-dir-validity) (file-notify-test05-dir-validity-remote): Adapt docstring. (file-notify-test04-file-validity): Let events arrive before calling final `file-notify-valid-p'. Do not ignore errors. (file-notify-test05-dir-validity): Do not manipulate `temporary-file-directory', it isn't necessary. Let events arrive before calling final `file-notify-valid-p'. Do not ignore errors.
Diffstat (limited to 'test')
-rw-r--r--test/automated/file-notify-tests.el40
1 files changed, 16 insertions, 24 deletions
diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el
index caf9316daa9..3e92925b68a 100644
--- a/test/automated/file-notify-tests.el
+++ b/test/automated/file-notify-tests.el
@@ -321,8 +321,7 @@ Don't wait longer than TIMEOUT seconds for the events to be delivered."
auto-revert-stop-on-user-input nil)
(ert-deftest file-notify-test03-autorevert ()
- "Check autorevert via file notification.
-This test is skipped in batch mode."
+ "Check autorevert via file notification."
(skip-unless (file-notify--test-local-enabled))
;; `auto-revert-buffers' runs every 5". And we must wait, until the
;; file has been reverted.
@@ -373,11 +372,10 @@ This test is skipped in batch mode."
(file-notify--test-cleanup))))
(file-notify--deftest-remote file-notify-test03-autorevert
- "Check autorevert via file notification for remote files.
-This test is skipped in batch mode.")
+ "Check autorevert via file notification for remote files.")
(ert-deftest file-notify-test04-file-validity ()
- "Check `file-notify-valid-p'."
+ "Check `file-notify-valid-p' for files."
(skip-unless (file-notify--test-local-enabled))
(unwind-protect
(let ((temporary-file-directory (make-temp-file
@@ -387,7 +385,6 @@ This test is skipped in batch mode.")
file-notify--test-tmpfile
'(change)
#'file-notify--test-event-handler))
-
(file-notify--test-with-events
3 3 (lambda (events)
(should (equal '(created changed deleted)
@@ -396,25 +393,22 @@ This test is skipped in batch mode.")
(write-region
"any text" nil file-notify--test-tmpfile nil 'no-message)
(should (file-notify-valid-p file-notify--test-desc))
- (delete-directory temporary-file-directory t)
- ;; After deleting the parent, the descriptor must not be
- ;; valid anymore.
- (should (not (file-notify-valid-p file-notify--test-desc)))))
+ (delete-directory temporary-file-directory t))
+ ;; After deleting the parent, the descriptor must not be valid
+ ;; anymore.
+ (should-not (file-notify-valid-p file-notify--test-desc)))
;; Exit.
- (ignore-errors
- (file-notify--test-cleanup))))
+ (file-notify--test-cleanup)))
(file-notify--deftest-remote file-notify-test04-file-validity
- "Check `file-notify-valid-p' via file notification for remote
-files.")
+ "Check `file-notify-valid-p' via file notification for remote files.")
(ert-deftest file-notify-test05-dir-validity ()
"Check `file-notify-valid-p' for directories."
(skip-unless (file-notify--test-local-enabled))
(unwind-protect
- (let ((temporary-file-directory (make-temp-file
- "file-notify-test-parent" t)))
+ (progn
(setq file-notify--test-tmpfile (file-name-as-directory
(file-notify--test-make-temp-name)))
(make-directory file-notify--test-tmpfile)
@@ -422,20 +416,18 @@ files.")
file-notify--test-tmpfile
'(change)
#'file-notify--test-event-handler))
-
(should (file-notify-valid-p file-notify--test-desc))
- (delete-directory temporary-file-directory t)
- ;; After deleting the parent, the descriptor must not be
+ (delete-directory file-notify--test-tmpfile t)
+ ;; After deleting the directory, the descriptor must not be
;; valid anymore.
- (should (not (file-notify-valid-p file-notify--test-desc))))
+ (read-event nil nil 0.1)
+ (should-not (file-notify-valid-p file-notify--test-desc)))
;; Exit.
- (ignore-errors
- (file-notify--test-cleanup))))
+ (file-notify--test-cleanup)))
(file-notify--deftest-remote file-notify-test05-dir-validity
- "Check `file-notify-valid-p' via file notification for remote
-directories.")
+ "Check `file-notify-valid-p' via file notification for remote directories.")
(defun file-notify-test-all (&optional interactive)
"Run all tests for \\[file-notify]."