diff options
| author | Eli Zaretskii | 2021-12-19 17:44:32 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2021-12-19 17:44:32 +0200 |
| commit | c139d289df4c76807501c3e35b0d8f4bc8d511ce (patch) | |
| tree | 630acb2f9b173508a3cd1919a1d336ca37e7da0c /test/src | |
| parent | cc63704815ee4ae686a0cf86e12f7f2596dd22a3 (diff) | |
| download | emacs-c139d289df4c76807501c3e35b0d8f4bc8d511ce.tar.gz emacs-c139d289df4c76807501c3e35b0d8f4bc8d511ce.zip | |
; Fix last change to filelock-tests.el
* test/src/filelock-tests.el (filelock-tests-file-locked-p-spoiled)
(filelock-tests-unlock-spoiled)
(filelock-tests-kill-buffer-spoiled): Expect 'permission-denied' only
on MS-Windows.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/filelock-tests.el | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/test/src/filelock-tests.el b/test/src/filelock-tests.el index 2d682e2e789..24dd37e5a4d 100644 --- a/test/src/filelock-tests.el +++ b/test/src/filelock-tests.el | |||
| @@ -123,7 +123,9 @@ the case)." | |||
| 123 | (filelock-tests--spoil-lock-file buffer-file-truename) | 123 | (filelock-tests--spoil-lock-file buffer-file-truename) |
| 124 | (let ((err (should-error (file-locked-p (buffer-file-name))))) | 124 | (let ((err (should-error (file-locked-p (buffer-file-name))))) |
| 125 | (should (equal (seq-subseq err 0 2) | 125 | (should (equal (seq-subseq err 0 2) |
| 126 | '(permission-denied "Testing file lock"))))))) | 126 | (if (eq system-type 'windows-nt) |
| 127 | '(permission-denied "Testing file lock") | ||
| 128 | '(file-error "Testing file lock")))))))) | ||
| 127 | 129 | ||
| 128 | (ert-deftest filelock-tests-unlock-spoiled () | 130 | (ert-deftest filelock-tests-unlock-spoiled () |
| 129 | "Check that `unlock-buffer' fails if the lockfile is \"spoiled\"." | 131 | "Check that `unlock-buffer' fails if the lockfile is \"spoiled\"." |
| @@ -144,8 +146,11 @@ the case)." | |||
| 144 | (lambda (err) (push err errors)))) | 146 | (lambda (err) (push err errors)))) |
| 145 | (unlock-buffer)) | 147 | (unlock-buffer)) |
| 146 | (should (consp errors)) | 148 | (should (consp errors)) |
| 147 | (should (equal '(permission-denied "Unlocking file") | 149 | (should (equal |
| 148 | (seq-subseq (car errors) 0 2))) | 150 | (if (eq system-type 'windows-nt) |
| 151 | '(permission-denied "Unlocking file") | ||
| 152 | '(file-error "Unlocking file")) | ||
| 153 | (seq-subseq (car errors) 0 2))) | ||
| 149 | (should (equal (length errors) 1)))))) | 154 | (should (equal (length errors) 1)))))) |
| 150 | 155 | ||
| 151 | (ert-deftest filelock-tests-kill-buffer-spoiled () | 156 | (ert-deftest filelock-tests-kill-buffer-spoiled () |
| @@ -174,8 +179,11 @@ the case)." | |||
| 174 | (lambda (err) (push err errors)))) | 179 | (lambda (err) (push err errors)))) |
| 175 | (kill-buffer)) | 180 | (kill-buffer)) |
| 176 | (should (consp errors)) | 181 | (should (consp errors)) |
| 177 | (should (equal '(permission-denied "Unlocking file") | 182 | (should (equal |
| 178 | (seq-subseq (car errors) 0 2))) | 183 | (if (eq system-type 'windows-nt) |
| 184 | '(permission-denied "Unlocking file") | ||
| 185 | '(file-error "Unlocking file")) | ||
| 186 | (seq-subseq (car errors) 0 2))) | ||
| 179 | (should (equal (length errors) 1)))))) | 187 | (should (equal (length errors) 1)))))) |
| 180 | 188 | ||
| 181 | (provide 'filelock-tests) | 189 | (provide 'filelock-tests) |