diff options
| author | Stephen Berman | 2018-07-30 14:12:50 +0200 |
|---|---|---|
| committer | Stephen Berman | 2018-07-30 14:12:50 +0200 |
| commit | 0252f7311f6ea968ea45933e275ae8cedbfaa1ef (patch) | |
| tree | 26304cddd8bc98a699c55bf55aeff6550cab825b | |
| parent | dd514347140087112cdc632ac766a76fb4fe27f0 (diff) | |
| download | emacs-0252f7311f6ea968ea45933e275ae8cedbfaa1ef.tar.gz emacs-0252f7311f6ea968ea45933e275ae8cedbfaa1ef.zip | |
* test/lisp/wdired-tests.el (wdired-test-symlink-name): New test.
| -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." | |||
| 74 | (if buf (kill-buffer buf)) | 74 | (if buf (kill-buffer buf)) |
| 75 | (delete-directory test-dir t))))) | 75 | (delete-directory test-dir t))))) |
| 76 | 76 | ||
| 77 | (ert-deftest wdired-test-symlink-name () | ||
| 78 | "Test the file name of a symbolic link. | ||
| 79 | The Dired and WDired functions returning the name should include | ||
| 80 | only the name before the link arrow." | ||
| 81 | (let* ((test-dir (make-temp-file "test-dir-" t)) | ||
| 82 | (link-name "foo")) | ||
| 83 | (let ((buf (find-file-noselect test-dir))) | ||
| 84 | (unwind-protect | ||
| 85 | (with-current-buffer buf | ||
| 86 | (make-symbolic-link "./bar/baz" link-name) | ||
| 87 | (revert-buffer) | ||
| 88 | (let* ((file-name (dired-get-filename)) | ||
| 89 | (dir-part (file-name-directory file-name)) | ||
| 90 | (lf-name (concat dir-part link-name))) | ||
| 91 | (should (equal file-name lf-name)) | ||
| 92 | (dired-toggle-read-only) | ||
| 93 | (should (equal (wdired-get-filename) lf-name)) | ||
| 94 | (dired-toggle-read-only))) | ||
| 95 | (if buf (kill-buffer buf)) | ||
| 96 | (delete-directory test-dir t))))) | ||
| 97 | |||
| 77 | (ert-deftest wdired-test-unfinished-edit-01 () | 98 | (ert-deftest wdired-test-unfinished-edit-01 () |
| 78 | "Test editing a file name without saving the change. | 99 | "Test editing a file name without saving the change. |
| 79 | Finding the new name should be possible while still in | 100 | Finding the new name should be possible while still in |