aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorEli Zaretskii2025-07-17 10:26:17 +0300
committerEli Zaretskii2025-07-17 10:26:17 +0300
commit29324fd0fa3755028466966b6eeb3cd0df1b442f (patch)
tree060e269fe1250b9bb9572f6b5b12a8b9d518d107 /test/src
parent6053a7f1a4a862bee6a83ab5d69531672c7f9652 (diff)
downloademacs-29324fd0fa3755028466966b6eeb3cd0df1b442f.tar.gz
emacs-29324fd0fa3755028466966b6eeb3cd0df1b442f.zip
; * test/src/fileio-tests.el (fileio-tests--read-directory): New test.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/fileio-tests.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el
index b6302c35fee..066dd901434 100644
--- a/test/src/fileio-tests.el
+++ b/test/src/fileio-tests.el
@@ -195,6 +195,21 @@ Also check that an encoding error can appear in a symlink."
195 (insert-file-contents "/dev/urandom" nil nil 10) 195 (insert-file-contents "/dev/urandom" nil nil 10)
196 (should (= (buffer-size) 10)))) 196 (should (= (buffer-size) 10))))
197 197
198(ert-deftest fileio-tests--read-directory ()
199 "Make sure insertring a directory fails with a platform-independent error."
200 (ert-with-temp-directory dir
201 (let* ((dir-name (directory-file-name dir))
202 (err (should-error (insert-file-contents dir-name)))
203 (desc-string
204 (if (eq system-type 'windows-nt)
205 "Opening input file"
206 "Read error")))
207 (should (equal err
208 (list 'file-error
209 desc-string
210 "Is a directory"
211 dir-name))))))
212
198(defun fileio-tests--identity-expand-handler (_ file &rest _) 213(defun fileio-tests--identity-expand-handler (_ file &rest _)
199 file) 214 file)
200(put 'fileio-tests--identity-expand-handler 'operations '(expand-file-name)) 215(put 'fileio-tests--identity-expand-handler 'operations '(expand-file-name))