From: Michael Albinus Date: Wed, 3 Jun 2015 18:03:42 +0000 (+0200) Subject: Fix error introduced recently in file-notify-tests.el X-Git-Tag: emacs-25.0.90~1879 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0c182b332d455b19c72e4bdd77bc7a728ac1e380;p=emacs.git Fix error introduced recently in file-notify-tests.el * test/automated/file-notify-tests.el (file-notify--test-remote-enabled): Do not use `file-notify--test-desc'. (file-notify--deftest-remote): Revert previous patch, not necessary anymore. --- diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el index 806bdd73bd1..11589b99295 100644 --- a/test/automated/file-notify-tests.el +++ b/test/automated/file-notify-tests.el @@ -85,21 +85,18 @@ being the result.") (defun file-notify--test-remote-enabled () "Whether remote file notification is enabled." (unless (consp file-notify--test-remote-enabled-checked) - (unwind-protect - (ignore-errors - (and - (file-remote-p file-notify-test-remote-temporary-file-directory) - (file-directory-p file-notify-test-remote-temporary-file-directory) - (file-writable-p file-notify-test-remote-temporary-file-directory) - (setq file-notify--test-desc - (file-notify-add-watch - file-notify-test-remote-temporary-file-directory - '(change) 'ignore)))) - ;; Unwind forms. - (setq file-notify--test-remote-enabled-checked - (cons t file-notify--test-desc)) - (when file-notify--test-desc - (file-notify-rm-watch file-notify--test-desc)))) + (let (desc) + (ignore-errors + (and + (file-remote-p file-notify-test-remote-temporary-file-directory) + (file-directory-p file-notify-test-remote-temporary-file-directory) + (file-writable-p file-notify-test-remote-temporary-file-directory) + (setq desc + (file-notify-add-watch + file-notify-test-remote-temporary-file-directory + '(change) 'ignore)))) + (setq file-notify--test-remote-enabled-checked (cons t desc)) + (when desc (file-notify-rm-watch desc)))) ;; Return result. (cdr file-notify--test-remote-enabled-checked)) @@ -108,21 +105,17 @@ being the result.") (declare (indent 1)) `(ert-deftest ,(intern (concat (symbol-name test) "-remote")) () ,docstring - (condition-case err - (let* ((temporary-file-directory - file-notify-test-remote-temporary-file-directory) - (ert-test (ert-get-test ',test))) - (skip-unless (file-notify--test-remote-enabled)) - (tramp-cleanup-connection - (tramp-dissect-file-name temporary-file-directory) - nil 'keep-password) - (funcall (ert-test-body ert-test))) - ((error quit) (ert-fail err))))) + (let* ((temporary-file-directory + file-notify-test-remote-temporary-file-directory) + (ert-test (ert-get-test ',test))) + (skip-unless (file-notify--test-remote-enabled)) + (tramp-cleanup-connection + (tramp-dissect-file-name temporary-file-directory) nil 'keep-password) + (funcall (ert-test-body ert-test))))) (ert-deftest file-notify-test00-availability () "Test availability of `file-notify'." (skip-unless (file-notify--test-local-enabled)) - ;; Check, that different valid parameters are accepted. (should (setq file-notify--test-desc (file-notify-add-watch temporary-file-directory '(change) 'ignore)))