aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorPaul Eggert2019-07-26 09:46:18 -0700
committerPaul Eggert2019-07-26 09:48:57 -0700
commite3575ee4b2fc8e74238dcc710c569885e1eef937 (patch)
treeb9dae51bfd36c335138dc9ece34b1775e6eb591b /test/src
parent40b067522fe122668350777451bb5b08e666842b (diff)
downloademacs-e3575ee4b2fc8e74238dcc710c569885e1eef937.tar.gz
emacs-e3575ee4b2fc8e74238dcc710c569885e1eef937.zip
Fix recently-introduced file-name-absolute-p typo
Fix a bug introduced in 2019-07-24T21:28:13!eggert@cs.ucla.edu. * src/fileio.c (file_name_absolute_p): ~/foo is also absolute (Bug#36809). * test/src/fileio-tests.el (fileio-tests--file-name-absolute-p): Rename from fileio-tests--no-such-user and add more tests.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/fileio-tests.el20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el
index 09a5b147e1d..98d3d6be763 100644
--- a/test/src/fileio-tests.el
+++ b/test/src/fileio-tests.el
@@ -137,13 +137,13 @@ Also check that an encoding error can appear in a symlink."
137 (should (and (file-name-absolute-p name) 137 (should (and (file-name-absolute-p name)
138 (not (eq (aref name 0) ?~)))))) 138 (not (eq (aref name 0) ?~))))))
139 139
140(ert-deftest fileio-tests--no-such-user () 140(ert-deftest fileio-tests--file-name-absolute-p ()
141 "Test file-name-absolute-p on ~nosuchuser." 141 "Test file-name-absolute-p."
142 (unless (user-full-name "nosuchuser") 142 (dolist (suffix '("" "/" "//" "/foo" "/foo/" "/foo//" "/foo/bar"))
143 (should (not (file-name-absolute-p "~nosuchuser"))) 143 (unless (string-equal suffix "")
144 (should (not (file-name-absolute-p "~nosuchuser/"))) 144 (should (file-name-absolute-p suffix)))
145 (should (not (file-name-absolute-p "~nosuchuser//"))) 145 (should (file-name-absolute-p (concat "~" suffix)))
146 (should (not (file-name-absolute-p "~nosuchuser/foo"))) 146 (when (user-full-name user-login-name)
147 (should (not (file-name-absolute-p "~nosuchuser/foo/"))) 147 (should (file-name-absolute-p (concat "~" user-login-name suffix))))
148 (should (not (file-name-absolute-p "~nosuchuser/foo//"))) 148 (unless (user-full-name "nosuchuser")
149 (should (not (file-name-absolute-p "~nosuchuser/foo/bar"))))) 149 (should (not (file-name-absolute-p (concat "~nosuchuser" suffix)))))))