diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2017-03-22 19:33:03 +0000 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2017-03-22 19:33:03 +0000 |
commit | 560d6f91246ee90ac6e630ae941097a4d4f8f730 (patch) | |
tree | 9fc886a0cc6f719a4bcd981634ffdbd58c6599c3 /test/lisp/filenotify-tests.el | |
parent | 716b46848989bc343797d98488a7a0cc33ed3179 (diff) | |
download | emacs-560d6f91246ee90ac6e630ae941097a4d4f8f730.tar.gz emacs-560d6f91246ee90ac6e630ae941097a4d4f8f730.tar.bz2 emacs-560d6f91246ee90ac6e630ae941097a4d4f8f730.zip |
Fix filenotify.el issue for kqueue
* lisp/filenotify.el (file-notify-add-watch): Use directory
for remote file name handlers.
* test/lisp/filenotify-tests.el (file-notify-test01-add-watch):
Create/delete temporary file only for "kqueue".
(file-notify-test02-rm-watch): Create/delete temporary files.
Diffstat (limited to 'test/lisp/filenotify-tests.el')
-rw-r--r-- | test/lisp/filenotify-tests.el | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index 654e1af1123..329ea58d3bb 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -294,13 +294,20 @@ This returns only for the local case and gfilenotify; otherwise it is nil. (file-notify-add-watch temporary-file-directory '(change attribute-change) #'ignore))) (file-notify-rm-watch file-notify--test-desc) - (write-region "any text" nil file-notify--test-tmpfile nil 'no-message) + + ;; File monitors like kqueue insist, that the watched file + ;; exists. Directory monitors are not bound to this + ;; restriction. + (when (string-equal (file-notify--test-library) "kqueue") + (write-region + "any text" nil file-notify--test-tmpfile nil 'no-message)) (should (setq file-notify--test-desc (file-notify-add-watch file-notify--test-tmpfile '(change attribute-change) #'ignore))) (file-notify-rm-watch file-notify--test-desc) - (delete-file file-notify--test-tmpfile) + (when (string-equal (file-notify--test-library) "kqueue") + (delete-file file-notify--test-tmpfile)) ;; Check error handling. (should-error (file-notify-add-watch 1 2 3 4) @@ -378,6 +385,8 @@ This returns only for the local case and gfilenotify; otherwise it is nil. (progn (setq file-notify--test-tmpfile (file-notify--test-make-temp-name) file-notify--test-tmpfile1 (file-notify--test-make-temp-name)) + (write-region "any text" nil file-notify--test-tmpfile nil 'no-message) + (write-region "any text" nil file-notify--test-tmpfile1 nil 'no-message) (should (setq file-notify--test-desc (file-notify-add-watch @@ -390,6 +399,8 @@ This returns only for the local case and gfilenotify; otherwise it is nil. (file-notify-rm-watch file-notify--test-desc) (file-notify-rm-watch file-notify--test-desc) (file-notify-rm-watch file-notify--test-desc1) + (delete-file file-notify--test-tmpfile) + (delete-file file-notify--test-tmpfile1) ;; The environment shall be cleaned up. (file-notify--test-cleanup-p)) |