aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2017-05-01 12:16:15 +0200
committerMichael Albinus2017-05-01 12:16:15 +0200
commitebff4177e2a0226aa1e65181307acfdadfbded3b (patch)
treeb25e862a92f9f9ce01e4907239ecc2aa4d7440da
parent04f915db9732d275ad1de8add8009c2af9d94d1f (diff)
downloademacs-ebff4177e2a0226aa1e65181307acfdadfbded3b.tar.gz
emacs-ebff4177e2a0226aa1e65181307acfdadfbded3b.zip
Fix filenotify-tests.el for cygwin
* test/lisp/filenotify-tests.el (file-notify--test-read-event): Add an additional `sit-for'. (file-notify-test02-rm-watch): Add an additional `file-notify--test-read-event' call.
-rw-r--r--lisp/filenotify.el4
-rw-r--r--test/lisp/filenotify-tests.el4
2 files changed, 5 insertions, 3 deletions
diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index 0a45db82192..64cfab143ec 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -188,8 +188,8 @@ EVENT is the cadr of the event in `file-notify-handle-event'
188 ((memq action '(attrib link)) 'attribute-changed) 188 ((memq action '(attrib link)) 'attribute-changed)
189 ((memq action '(create added)) 'created) 189 ((memq action '(create added)) 'created)
190 ((memq action '(modify modified write)) 'changed) 190 ((memq action '(modify modified write)) 'changed)
191 ((memq action 191 ((memq action '(delete delete-self move-self removed))
192 '(delete delete-self move-self removed)) 'deleted) 192 'deleted)
193 ;; Make the event pending. 193 ;; Make the event pending.
194 ((memq action '(moved-from renamed-from)) 194 ((memq action '(moved-from renamed-from))
195 (setq file-notify--pending-event 195 (setq file-notify--pending-event
diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el
index 54e7ebfc0e5..78a68f21bd1 100644
--- a/test/lisp/filenotify-tests.el
+++ b/test/lisp/filenotify-tests.el
@@ -69,6 +69,7 @@
69(defun file-notify--test-read-event () 69(defun file-notify--test-read-event ()
70 "Read one event. 70 "Read one event.
71There are different timeouts for local and remote file notification libraries." 71There are different timeouts for local and remote file notification libraries."
72 (sit-for 0.001 'nodisp)
72 (read-event 73 (read-event
73 nil nil 74 nil nil
74 (cond 75 (cond
@@ -426,6 +427,7 @@ This returns only for the local case and gfilenotify; otherwise it is nil.
426 ;; Remove first watch. 427 ;; Remove first watch.
427 (file-notify-rm-watch file-notify--test-desc) 428 (file-notify-rm-watch file-notify--test-desc)
428 ;; Only the second callback shall run. 429 ;; Only the second callback shall run.
430 (file-notify--test-read-event)
429 (delete-file file-notify--test-tmpfile) 431 (delete-file file-notify--test-tmpfile)
430 (file-notify--wait-for-events 432 (file-notify--wait-for-events
431 (file-notify--test-timeout) results) 433 (file-notify--test-timeout) results)
@@ -953,7 +955,7 @@ delivered."
953 ;; After deleting the parent directory, the descriptor must 955 ;; After deleting the parent directory, the descriptor must
954 ;; not be valid anymore. 956 ;; not be valid anymore.
955 (should-not (file-notify-valid-p file-notify--test-desc)) 957 (should-not (file-notify-valid-p file-notify--test-desc))
956 ;; w32notify doesn't generate 'stopped' events when the parent 958 ;; w32notify doesn't generate `stopped' events when the parent
957 ;; directory is deleted, which doesn't provide a chance for 959 ;; directory is deleted, which doesn't provide a chance for
958 ;; filenotify.el to remove the descriptor from the internal 960 ;; filenotify.el to remove the descriptor from the internal
959 ;; hash table it maintains. So we must remove the descriptor 961 ;; hash table it maintains. So we must remove the descriptor