From: Jim Porter Date: Mon, 15 Nov 2021 12:34:00 +0000 (+0100) Subject: Add another 'abbreviate-file-name' test X-Git-Tag: emacs-29.0.90~2852^2~271 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=83023117de77c3c41286b0eeb56e2e5417080c43;p=emacs.git Add another 'abbreviate-file-name' test * test/lisp/files-tests.el (files-tests-file-name-non-special-abbreviate-file-name): New test. --- diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index d00f1ce3263..2c4557ead61 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el @@ -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.