emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 0c182b3: Fix error introduced recently in file-noti


From: Michael Albinus
Subject: [Emacs-diffs] master 0c182b3: Fix error introduced recently in file-notify-tests.el
Date: Wed, 03 Jun 2015 18:03:51 +0000

branch: master
commit 0c182b332d455b19c72e4bdd77bc7a728ac1e380
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    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.
---
 test/automated/file-notify-tests.el |   45 ++++++++++++++--------------------
 1 files changed, 19 insertions(+), 26 deletions(-)

diff --git a/test/automated/file-notify-tests.el 
b/test/automated/file-notify-tests.el
index 806bdd7..11589b9 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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]