From 054f1c162ad2ed5538b4fcf07745febb1786e573 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 6 Jan 2019 16:35:38 +0100 Subject: [PATCH] Adapt filenotify-tests --- lisp/filenotify.el | 11 +++++------ test/lisp/filenotify-tests.el | 18 +++++++++--------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/lisp/filenotify.el b/lisp/filenotify.el index c05e0657aff..ef3be8a4a9b 100644 --- a/lisp/filenotify.el +++ b/lisp/filenotify.el @@ -239,11 +239,11 @@ EVENT is the cadr of the event in `file-notify-handle-event' (string-equal (file-notify--watch-filename watch) (file-name-nondirectory file1))))) - (message - "file-notify-callback %S %S %S %S %S %S %S" - desc action file file1 watch - (file-notify--event-watched-file event) - (file-notify--watch-directory watch)) + ;;(message + ;;"file-notify-callback %S %S %S %S %S %S %S" + ;;desc action file file1 watch + ;;(file-notify--event-watched-file event) + ;;(file-notify--watch-directory watch)) (funcall (file-notify--watch-callback watch) (if file1 `(,desc ,action ,file ,file1) @@ -421,7 +421,6 @@ DESCRIPTOR should be an object returned by `file-notify-add-watch'." descriptor)) t)))) - ;; TODO: ;; * Watching a file in an already watched directory. diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index ee2bc30353c..b74d939519f 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -690,7 +690,7 @@ delivered." '(created changed deleted stopped)) ;; inotify on emba does not detect `deleted' and ;; `stopped' events of the directory. - ((and (string-equal (file-notify--test-library) "inotify") + ((and (string-match "inotify" (file-notify--test-library)) (getenv "EMACS_EMBA_CI")) '(created changed deleted)) (t '(created changed deleted deleted stopped))) @@ -740,7 +740,7 @@ delivered." '(created changed created changed deleted stopped)) ;; inotify on emba does not detect `deleted' and ;; `stopped' events of the directory. - ((and (string-equal (file-notify--test-library) "inotify") + ((and (string-match "inotify" (file-notify--test-library)) (getenv "EMACS_EMBA_CI")) '(created changed created changed deleted deleted)) (t '(created changed created changed @@ -797,7 +797,7 @@ delivered." '(created changed renamed deleted stopped)) ;; inotify on emba does not detect `deleted' and ;; `stopped' events of the directory. - ((and (string-equal (file-notify--test-library) "inotify") + ((and (string-match "inotify" (file-notify--test-library)) (getenv "EMACS_EMBA_CI")) '(created changed renamed deleted)) (t '(created changed renamed deleted deleted stopped))) @@ -1019,7 +1019,7 @@ delivered." ;; inotify on emba does not detect `deleted' and ;; `stopped' events of the directory. - (unless (and (string-equal (file-notify--test-library) "inotify") + (unless (and (string-match "inotify" (file-notify--test-library)) (getenv "EMACS_EMBA_CI")) (unwind-protect (let ((file-notify--test-tmpdir @@ -1106,7 +1106,7 @@ delivered." ;; inotify on emba does not detect `deleted' and ;; `stopped' events of the directory. - (unless (and (string-equal (file-notify--test-library) "inotify") + (unless (and (string-match "inotify" (file-notify--test-library)) (getenv "EMACS_EMBA_CI")) (unwind-protect (progn @@ -1199,7 +1199,7 @@ delivered." (delete-file file))) (delete-directory file-notify--test-tmpfile) (if (or (string-equal (file-notify--test-library) "w32notify") - (and (string-equal (file-notify--test-library) "inotify") + (and (string-match "inotify" (file-notify--test-library)) (getenv "EMACS_EMBA_CI"))) (file-notify--rm-descriptor file-notify--test-desc)) @@ -1411,17 +1411,17 @@ the file watch." ((string-equal (file-notify--test-library) "w32notify") '()) ;; inotify on emba does not detect `deleted' and ;; `stopped' events of the directory. - ((and (string-equal (file-notify--test-library) "inotify") + ((and (string-match "inotify" (file-notify--test-library)) (getenv "EMACS_EMBA_CI")) '()) (t '(deleted stopped)))))) (delete-directory file-notify--test-tmpfile 'recursive)) - (unless (and (string-equal (file-notify--test-library) "inotify") + (unless (and (string-match "inotify" (file-notify--test-library)) (getenv "EMACS_EMBA_CI")) (should-not (file-notify-valid-p file-notify--test-desc1)) (should-not (file-notify-valid-p file-notify--test-desc2))) (when (or (string-equal (file-notify--test-library) "w32notify") - (and (string-equal (file-notify--test-library) "inotify") + (and (string-match "inotify" (file-notify--test-library)) (getenv "EMACS_EMBA_CI"))) (file-notify--rm-descriptor file-notify--test-desc1) (file-notify--rm-descriptor file-notify--test-desc2)) -- 2.39.5