aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorEli Zaretskii2021-12-19 17:29:40 +0200
committerEli Zaretskii2021-12-19 17:29:40 +0200
commitcc63704815ee4ae686a0cf86e12f7f2596dd22a3 (patch)
treef0d6215f0f35bf3538ec3601e49bc54f0d91f0fa /test/src
parent8f82a83caec9ad48a6d4abc4dc26bed67f0e89e3 (diff)
downloademacs-cc63704815ee4ae686a0cf86e12f7f2596dd22a3.tar.gz
emacs-cc63704815ee4ae686a0cf86e12f7f2596dd22a3.zip
New error symbol 'permission-denied'
* src/fileio.c (syms_of_fileio) <permission-denied>: Define the symbol and its 'err-conditions' and 'error-message' properties. (get_file_errno_data): Return permission-denied on EACCES. * test/src/filelock-tests.el (filelock-tests-file-locked-p-spoiled) (filelock-tests-unlock-spoiled) (filelock-tests-kill-buffer-spoiled): Adapt the tests to the new error symbol. * doc/lispref/errors.texi (Standard Errors): * etc/NEWS: Document 'permission-denied' error.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/filelock-tests.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/src/filelock-tests.el b/test/src/filelock-tests.el
index ba001679639..2d682e2e789 100644
--- a/test/src/filelock-tests.el
+++ b/test/src/filelock-tests.el
@@ -123,7 +123,7 @@ 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 '(file-error "Testing file lock"))))))) 126 '(permission-denied "Testing file lock")))))))
127 127
128(ert-deftest filelock-tests-unlock-spoiled () 128(ert-deftest filelock-tests-unlock-spoiled ()
129 "Check that `unlock-buffer' fails if the lockfile is \"spoiled\"." 129 "Check that `unlock-buffer' fails if the lockfile is \"spoiled\"."
@@ -144,7 +144,7 @@ the case)."
144 (lambda (err) (push err errors)))) 144 (lambda (err) (push err errors))))
145 (unlock-buffer)) 145 (unlock-buffer))
146 (should (consp errors)) 146 (should (consp errors))
147 (should (equal '(file-error "Unlocking file") 147 (should (equal '(permission-denied "Unlocking file")
148 (seq-subseq (car errors) 0 2))) 148 (seq-subseq (car errors) 0 2)))
149 (should (equal (length errors) 1)))))) 149 (should (equal (length errors) 1))))))
150 150
@@ -174,7 +174,7 @@ the case)."
174 (lambda (err) (push err errors)))) 174 (lambda (err) (push err errors))))
175 (kill-buffer)) 175 (kill-buffer))
176 (should (consp errors)) 176 (should (consp errors))
177 (should (equal '(file-error "Unlocking file") 177 (should (equal '(permission-denied "Unlocking file")
178 (seq-subseq (car errors) 0 2))) 178 (seq-subseq (car errors) 0 2)))
179 (should (equal (length errors) 1)))))) 179 (should (equal (length errors) 1))))))
180 180