diff options
| author | Michael Albinus | 2023-10-14 09:34:40 +0200 |
|---|---|---|
| committer | Michael Albinus | 2023-10-14 09:34:40 +0200 |
| commit | dc8b336d0254d751ffcb2466a20a650ca9c5f86a (patch) | |
| tree | c2498f9aa881674609cecddd0b301791e9a4985b /test/lisp/files-tests.el | |
| parent | c8ea14e7825d536f41a230fc1298341a2462635e (diff) | |
| download | emacs-dc8b336d0254d751ffcb2466a20a650ca9c5f86a.tar.gz emacs-dc8b336d0254d751ffcb2466a20a650ca9c5f86a.zip | |
* lisp/files.el (file-name-non-special): Handle quoted tilde.
(Bug#65685)
* test/lisp/files-tests.el
(files-tests-file-name-non-special-expand-file-name-tilde):
New test.
Diffstat (limited to 'test/lisp/files-tests.el')
| -rw-r--r-- | test/lisp/files-tests.el | 17 |
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." | |||
| 662 | (files-tests--with-temp-non-special-and-file-name-handler (tmpfile nospecial) | 662 | (files-tests--with-temp-non-special-and-file-name-handler (tmpfile nospecial) |
| 663 | (should (equal (expand-file-name nospecial) nospecial)))) | 663 | (should (equal (expand-file-name nospecial) nospecial)))) |
| 664 | 664 | ||
| 665 | (ert-deftest files-tests-file-name-non-special-expand-file-name-tilde () | ||
| 666 | (let ((process-environment | ||
| 667 | (cons (format "HOME=%s" temporary-file-directory) process-environment)) | ||
| 668 | abbreviated-home-dir) | ||
| 669 | (files-tests--with-temp-non-special (tmpfile nospecial) | ||
| 670 | (let (file-name-handler-alist) | ||
| 671 | (setq nospecial (file-name-quote (abbreviate-file-name tmpfile)))) | ||
| 672 | (should (equal (expand-file-name nospecial) | ||
| 673 | (expand-file-name (file-name-unquote nospecial t))))) | ||
| 674 | (files-tests--with-temp-non-special-and-file-name-handler (tmpfile nospecial) | ||
| 675 | (let (file-name-handler-alist) | ||
| 676 | (setq nospecial (file-name-quote (abbreviate-file-name tmpfile)))) | ||
| 677 | (should-not | ||
| 678 | (equal (expand-file-name nospecial) | ||
| 679 | ;; The file name handler deletes the ".special" extension. | ||
| 680 | (expand-file-name (file-name-unquote nospecial t))))))) | ||
| 681 | |||
| 665 | (ert-deftest files-tests-file-name-non-special-file-accessible-directory-p () | 682 | (ert-deftest files-tests-file-name-non-special-file-accessible-directory-p () |
| 666 | (files-tests--with-temp-non-special (tmpdir nospecial-dir t) | 683 | (files-tests--with-temp-non-special (tmpdir nospecial-dir t) |
| 667 | (should (file-accessible-directory-p nospecial-dir))) | 684 | (should (file-accessible-directory-p nospecial-dir))) |