From 83023117de77c3c41286b0eeb56e2e5417080c43 Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Mon, 15 Nov 2021 13:34:00 +0100 Subject: [PATCH] Add another 'abbreviate-file-name' test * test/lisp/files-tests.el (files-tests-file-name-non-special-abbreviate-file-name): New test. --- test/lisp/files-tests.el | 9 +++++++++ 1 file changed, 9 insertions(+) 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. -- 2.39.2