diff options
| author | Michael Albinus | 2019-01-07 16:59:43 +0100 |
|---|---|---|
| committer | Michael Albinus | 2019-01-07 16:59:43 +0100 |
| commit | b513feb812496ce357e99e2e2ae611cb37d5a3fa (patch) | |
| tree | 6ca54135131a2d70fe5d0965574dad71f83ae2a2 | |
| parent | 536e6dea0f9302ef69d1bb12d0efc852c630d1ca (diff) | |
| download | emacs-b513feb812496ce357e99e2e2ae611cb37d5a3fa.tar.gz emacs-b513feb812496ce357e99e2e2ae611cb37d5a3fa.zip | |
; Format filenotify-tests.el
| -rw-r--r-- | test/lisp/filenotify-tests.el | 121 |
1 files changed, 61 insertions, 60 deletions
diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index fdc8d00d86d..50036209b0f 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el | |||
| @@ -450,36 +450,36 @@ This returns only for the local case and gfilenotify; otherwise it is nil. | |||
| 450 | ;; harm. This fails on Cygwin because of timing issues unless a | 450 | ;; harm. This fails on Cygwin because of timing issues unless a |
| 451 | ;; long `sit-for' is added before the call to | 451 | ;; long `sit-for' is added before the call to |
| 452 | ;; `file-notify--test-read-event'. | 452 | ;; `file-notify--test-read-event'. |
| 453 | (if (not (eq system-type 'cygwin)) | 453 | (unless (eq system-type 'cygwin) |
| 454 | (let (results) | 454 | (let (results) |
| 455 | (cl-flet ((first-callback (event) | 455 | (cl-flet ((first-callback (event) |
| 456 | (when (eq (nth 1 event) 'deleted) (push 1 results))) | 456 | (when (eq (nth 1 event) 'deleted) (push 1 results))) |
| 457 | (second-callback (event) | 457 | (second-callback (event) |
| 458 | (when (eq (nth 1 event) 'deleted) (push 2 results)))) | 458 | (when (eq (nth 1 event) 'deleted) (push 2 results)))) |
| 459 | (setq file-notify--test-tmpfile (file-notify--test-make-temp-name)) | 459 | (setq file-notify--test-tmpfile (file-notify--test-make-temp-name)) |
| 460 | (write-region | 460 | (write-region |
| 461 | "any text" nil file-notify--test-tmpfile nil 'no-message) | 461 | "any text" nil file-notify--test-tmpfile nil 'no-message) |
| 462 | (should | 462 | (should |
| 463 | (setq file-notify--test-desc | 463 | (setq file-notify--test-desc |
| 464 | (file-notify-add-watch | 464 | (file-notify-add-watch |
| 465 | file-notify--test-tmpfile | 465 | file-notify--test-tmpfile |
| 466 | '(change) #'first-callback))) | 466 | '(change) #'first-callback))) |
| 467 | (should | 467 | (should |
| 468 | (setq file-notify--test-desc1 | 468 | (setq file-notify--test-desc1 |
| 469 | (file-notify-add-watch | 469 | (file-notify-add-watch |
| 470 | file-notify--test-tmpfile | 470 | file-notify--test-tmpfile |
| 471 | '(change) #'second-callback))) | 471 | '(change) #'second-callback))) |
| 472 | ;; Remove first watch. | 472 | ;; Remove first watch. |
| 473 | (file-notify-rm-watch file-notify--test-desc) | 473 | (file-notify-rm-watch file-notify--test-desc) |
| 474 | ;; Only the second callback shall run. | 474 | ;; Only the second callback shall run. |
| 475 | (file-notify--test-read-event) | 475 | (file-notify--test-read-event) |
| 476 | (delete-file file-notify--test-tmpfile) | 476 | (delete-file file-notify--test-tmpfile) |
| 477 | (file-notify--wait-for-events | 477 | (file-notify--wait-for-events |
| 478 | (file-notify--test-timeout) results) | 478 | (file-notify--test-timeout) results) |
| 479 | (should (equal results (list 2))) | 479 | (should (equal results (list 2))) |
| 480 | 480 | ||
| 481 | ;; The environment shall be cleaned up. | 481 | ;; The environment shall be cleaned up. |
| 482 | (file-notify--test-cleanup-p)))) | 482 | (file-notify--test-cleanup-p)))) |
| 483 | 483 | ||
| 484 | ;; Cleanup. | 484 | ;; Cleanup. |
| 485 | (file-notify--test-cleanup))) | 485 | (file-notify--test-cleanup))) |
| @@ -1014,9 +1014,10 @@ delivered." | |||
| 1014 | ;; Cleanup. | 1014 | ;; Cleanup. |
| 1015 | (file-notify--test-cleanup)) | 1015 | (file-notify--test-cleanup)) |
| 1016 | 1016 | ||
| 1017 | ;; On emba, `deleted' and `stopped' events of the directory are not detected. | 1017 | (unwind-protect |
| 1018 | (unless (getenv "EMACS_EMBA_CI") | 1018 | ;; On emba, `deleted' and `stopped' events of the directory are |
| 1019 | (unwind-protect | 1019 | ;; not detected. |
| 1020 | (unless (getenv "EMACS_EMBA_CI") | ||
| 1020 | (let ((file-notify--test-tmpdir | 1021 | (let ((file-notify--test-tmpdir |
| 1021 | (make-temp-file "file-notify-test-parent" t))) | 1022 | (make-temp-file "file-notify-test-parent" t))) |
| 1022 | (should | 1023 | (should |
| @@ -1062,10 +1063,10 @@ delivered." | |||
| 1062 | (file-notify--rm-descriptor file-notify--test-desc)) | 1063 | (file-notify--rm-descriptor file-notify--test-desc)) |
| 1063 | 1064 | ||
| 1064 | ;; The environment shall be cleaned up. | 1065 | ;; The environment shall be cleaned up. |
| 1065 | (file-notify--test-cleanup-p)) | 1066 | (file-notify--test-cleanup-p))) |
| 1066 | 1067 | ||
| 1067 | ;; Cleanup. | 1068 | ;; Cleanup. |
| 1068 | (file-notify--test-cleanup)))) | 1069 | (file-notify--test-cleanup))) |
| 1069 | 1070 | ||
| 1070 | (file-notify--deftest-remote file-notify-test05-file-validity | 1071 | (file-notify--deftest-remote file-notify-test05-file-validity |
| 1071 | "Check `file-notify-valid-p' via file notification for remote files.") | 1072 | "Check `file-notify-valid-p' via file notification for remote files.") |
| @@ -1099,33 +1100,33 @@ delivered." | |||
| 1099 | ;; Cleanup. | 1100 | ;; Cleanup. |
| 1100 | (file-notify--test-cleanup)) | 1101 | (file-notify--test-cleanup)) |
| 1101 | 1102 | ||
| 1102 | ;; On emba, `deleted' and `stopped' events of the directory are not detected. | 1103 | (unwind-protect |
| 1103 | (unless (getenv "EMACS_EMBA_CI") | 1104 | ;; On emba, `deleted' and `stopped' events of the directory are |
| 1104 | (unwind-protect | 1105 | ;; not detected. |
| 1105 | (progn | 1106 | (unless (getenv "EMACS_EMBA_CI") |
| 1106 | (should | 1107 | (should |
| 1107 | (setq file-notify--test-tmpfile | 1108 | (setq file-notify--test-tmpfile |
| 1108 | (make-temp-file "file-notify-test-parent" t))) | 1109 | (make-temp-file "file-notify-test-parent" t))) |
| 1109 | (should | 1110 | (should |
| 1110 | (setq file-notify--test-desc | 1111 | (setq file-notify--test-desc |
| 1111 | (file-notify-add-watch | 1112 | (file-notify-add-watch |
| 1112 | file-notify--test-tmpfile '(change) #'ignore))) | 1113 | file-notify--test-tmpfile '(change) #'ignore))) |
| 1113 | (should (file-notify-valid-p file-notify--test-desc)) | 1114 | (should (file-notify-valid-p file-notify--test-desc)) |
| 1114 | ;; After deleting the directory, the descriptor must not be | 1115 | ;; After deleting the directory, the descriptor must not be |
| 1115 | ;; valid anymore. | 1116 | ;; valid anymore. |
| 1116 | (delete-directory file-notify--test-tmpfile 'recursive) | 1117 | (delete-directory file-notify--test-tmpfile 'recursive) |
| 1117 | (file-notify--wait-for-events | 1118 | (file-notify--wait-for-events |
| 1118 | (file-notify--test-timeout) | 1119 | (file-notify--test-timeout) |
| 1119 | (not (file-notify-valid-p file-notify--test-desc))) | 1120 | (not (file-notify-valid-p file-notify--test-desc))) |
| 1120 | (should-not (file-notify-valid-p file-notify--test-desc)) | 1121 | (should-not (file-notify-valid-p file-notify--test-desc)) |
| 1121 | (if (string-equal (file-notify--test-library) "w32notify") | 1122 | (if (string-equal (file-notify--test-library) "w32notify") |
| 1122 | (file-notify--rm-descriptor file-notify--test-desc)) | 1123 | (file-notify--rm-descriptor file-notify--test-desc)) |
| 1123 | 1124 | ||
| 1124 | ;; The environment shall be cleaned up. | 1125 | ;; The environment shall be cleaned up. |
| 1125 | (file-notify--test-cleanup-p)) | 1126 | (file-notify--test-cleanup-p)) |
| 1126 | 1127 | ||
| 1127 | ;; Cleanup. | 1128 | ;; Cleanup. |
| 1128 | (file-notify--test-cleanup)))) | 1129 | (file-notify--test-cleanup))) |
| 1129 | 1130 | ||
| 1130 | (file-notify--deftest-remote file-notify-test06-dir-validity | 1131 | (file-notify--deftest-remote file-notify-test06-dir-validity |
| 1131 | "Check `file-notify-valid-p' via file notification for remote directories.") | 1132 | "Check `file-notify-valid-p' via file notification for remote directories.") |