aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
Diffstat (limited to 'test/src')
-rw-r--r--test/src/fileio-tests.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el
index f4d123b4261..438ebebb769 100644
--- a/test/src/fileio-tests.el
+++ b/test/src/fileio-tests.el
@@ -136,6 +136,15 @@ Also check that an encoding error can appear in a symlink."
136 (should (and (file-name-absolute-p name) 136 (should (and (file-name-absolute-p name)
137 (not (eq (aref name 0) ?~)))))) 137 (not (eq (aref name 0) ?~))))))
138 138
139(ert-deftest fileio-test--expand-file-name-null-bytes ()
140 "Test that expand-file-name checks for null bytes in filenames."
141 (should-error (expand-file-name (concat "file" (char-to-string ?\0) ".txt"))
142 :type 'wrong-type-argument)
143 (should-error (expand-file-name "file.txt" (concat "dir" (char-to-string ?\0)))
144 :type 'wrong-type-argument)
145 (let ((default-directory (concat "dir" (char-to-string ?\0))))
146 (should-error (expand-file-name "file.txt") :type 'wrong-type-argument)))
147
139(ert-deftest fileio-tests--file-name-absolute-p () 148(ert-deftest fileio-tests--file-name-absolute-p ()
140 "Test file-name-absolute-p." 149 "Test file-name-absolute-p."
141 (dolist (suffix '("" "/" "//" "/foo" "/foo/" "/foo//" "/foo/bar")) 150 (dolist (suffix '("" "/" "//" "/foo" "/foo/" "/foo//" "/foo/bar"))