"Test using non-nil wdired-use-interactive-rename.
Partially modifying a file name should succeed."
(ert-with-temp-directory test-dir
+ ;; The call to file-truename is for MS-Windows, where numeric
+ ;; tails or some other feature (like SUBST) could cause file names
+ ;; to fail to compare 'equal'.
+ (setq test-dir (file-truename test-dir))
(let* ((test-file (concat (file-name-as-directory test-dir) "foo.c"))
(replace "bar")
(new-file (string-replace "foo" replace test-file))
"Test using non-nil wdired-use-interactive-rename.
Aborting an edit should leaving original file name unchanged."
(ert-with-temp-directory test-dir
+ (setq test-dir (file-truename test-dir))
(let* ((test-file (concat (file-name-as-directory test-dir) "foo.c"))
(wdired-use-interactive-rename t))
(write-region "" nil test-file nil 'silent)
Finding the new name should be possible while still in
wdired-mode."
(ert-with-temp-directory test-dir
+ (setq test-dir (file-truename test-dir))
(let* ((test-file (concat (file-name-as-directory test-dir) "foo.c"))
(replace "bar")
(new-file (string-replace "foo" replace test-file)))
(with-current-buffer buf
(dired-create-empty-file "foo")
(set-file-modes "foo" (file-modes-symbolic-to-number "+x"))
- (make-symbolic-link "foo" "bar")
+ (skip-unless
+ ;; This check is for wdired, not symbolic links, so skip
+ ;; it when make-symbolic-link fails for any reason (like
+ ;; insufficient privileges).
+ (ignore-errors (make-symbolic-link "foo" "bar") t))
(make-directory "foodir")
(dired-smart-shell-command "mkfifo foopipe")
(when (featurep 'make-network-process '(:family local))
(ert-deftest wdired-test-bug39280 ()
"Test for https://debbugs.gnu.org/39280."
(ert-with-temp-directory test-dir
+ (setq test-dir (file-truename test-dir))
(let* ((fname "foo")
(full-fname (expand-file-name fname test-dir)))
(make-empty-file full-fname)
(dired-hide-details-hide-symlink-targets t))
(unwind-protect
(with-current-buffer buf
- (make-symbolic-link "bar" "foo")
+ (skip-unless
+ ;; This check is for wdired, not symbolic links, so skip
+ ;; it when make-symbolic-link fails for any reason (like
+ ;; insufficient privileges).
+ (ignore-errors (make-symbolic-link "bar" "foo") t))
(dired-hide-details-mode)
(should (memq 'dired-hide-details-link buffer-invisibility-spec))
(dired-toggle-read-only)