]> git.eshelyaron.com Git - emacs.git/commitdiff
Add another 'abbreviate-file-name' test
authorJim Porter <jporterbugs@gmail.com>
Mon, 15 Nov 2021 12:34:00 +0000 (13:34 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Mon, 15 Nov 2021 12:34:00 +0000 (13:34 +0100)
* test/lisp/files-tests.el
(files-tests-file-name-non-special-abbreviate-file-name): New test.

test/lisp/files-tests.el

index d00f1ce326311f30c2b5946cf808b46f43fdb838..2c4557ead611a240e3e046747e23ef56e5e3ecb1 100644 (file)
@@ -465,6 +465,15 @@ unquoted file names."
   (let (file-name-handler-alist)
     (concat (file-name-sans-extension name) part (file-name-extension name t))))
 
+(ert-deftest files-tests-file-name-non-special-abbreviate-file-name ()
+  (let* ((homedir temporary-file-directory)
+         (process-environment (cons (format "HOME=%s" homedir)
+                                    process-environment))
+         (abbreviated-home-dir nil))
+    ;; Check that abbreviation doesn't occur for quoted file names.
+    (should (equal (concat "/:" homedir "foo/bar")
+                   (abbreviate-file-name (concat "/:" homedir "foo/bar"))))))
+
 (ert-deftest files-tests-file-name-non-special-access-file ()
   (files-tests--with-temp-non-special (tmpfile nospecial)
     ;; Both versions of the file name work.