summaryrefslogtreecommitdiff
path: root/test/lisp/files-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/files-tests.el')
-rw-r--r--test/lisp/files-tests.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index aadb60e1de7..8f6495a293c 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -662,6 +662,23 @@ unquoted file names."
(files-tests--with-temp-non-special-and-file-name-handler (tmpfile nospecial)
(should (equal (expand-file-name nospecial) nospecial))))
+(ert-deftest files-tests-file-name-non-special-expand-file-name-tilde ()
+ (let ((process-environment
+ (cons (format "HOME=%s" temporary-file-directory) process-environment))
+ abbreviated-home-dir)
+ (files-tests--with-temp-non-special (tmpfile nospecial)
+ (let (file-name-handler-alist)
+ (setq nospecial (file-name-quote (abbreviate-file-name tmpfile))))
+ (should (equal (expand-file-name nospecial)
+ (expand-file-name (file-name-unquote nospecial t)))))
+ (files-tests--with-temp-non-special-and-file-name-handler (tmpfile nospecial)
+ (let (file-name-handler-alist)
+ (setq nospecial (file-name-quote (abbreviate-file-name tmpfile))))
+ (should-not
+ (equal (expand-file-name nospecial)
+ ;; The file name handler deletes the ".special" extension.
+ (expand-file-name (file-name-unquote nospecial t)))))))
+
(ert-deftest files-tests-file-name-non-special-file-accessible-directory-p ()
(files-tests--with-temp-non-special (tmpdir nospecial-dir t)
(should (file-accessible-directory-p nospecial-dir)))