diff options
author | Stephen Berman <stephen.berman@gmx.net> | 2018-07-30 14:12:50 +0200 |
---|---|---|
committer | Stephen Berman <stephen.berman@gmx.net> | 2018-07-30 14:12:50 +0200 |
commit | 0252f7311f6ea968ea45933e275ae8cedbfaa1ef (patch) | |
tree | 26304cddd8bc98a699c55bf55aeff6550cab825b /test/lisp/wdired-tests.el | |
parent | dd514347140087112cdc632ac766a76fb4fe27f0 (diff) | |
download | emacs-0252f7311f6ea968ea45933e275ae8cedbfaa1ef.tar.gz emacs-0252f7311f6ea968ea45933e275ae8cedbfaa1ef.tar.bz2 emacs-0252f7311f6ea968ea45933e275ae8cedbfaa1ef.zip |
* test/lisp/wdired-tests.el (wdired-test-symlink-name): New test.
Diffstat (limited to 'test/lisp/wdired-tests.el')
-rw-r--r-- | test/lisp/wdired-tests.el | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/lisp/wdired-tests.el b/test/lisp/wdired-tests.el index 7199470ea96..bf09d43ed73 100644 --- a/test/lisp/wdired-tests.el +++ b/test/lisp/wdired-tests.el @@ -74,6 +74,27 @@ Aborting an edit should leaving original file name unchanged." (if buf (kill-buffer buf)) (delete-directory test-dir t))))) +(ert-deftest wdired-test-symlink-name () + "Test the file name of a symbolic link. +The Dired and WDired functions returning the name should include +only the name before the link arrow." + (let* ((test-dir (make-temp-file "test-dir-" t)) + (link-name "foo")) + (let ((buf (find-file-noselect test-dir))) + (unwind-protect + (with-current-buffer buf + (make-symbolic-link "./bar/baz" link-name) + (revert-buffer) + (let* ((file-name (dired-get-filename)) + (dir-part (file-name-directory file-name)) + (lf-name (concat dir-part link-name))) + (should (equal file-name lf-name)) + (dired-toggle-read-only) + (should (equal (wdired-get-filename) lf-name)) + (dired-toggle-read-only))) + (if buf (kill-buffer buf)) + (delete-directory test-dir t))))) + (ert-deftest wdired-test-unfinished-edit-01 () "Test editing a file name without saving the change. Finding the new name should be possible while still in |