summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2023-03-03 06:30:12 +0100
committerStefan Kangas <stefankangas@gmail.com>2023-03-03 06:30:12 +0100
commit841614c72272146fff1b9afa05d52150da6d6e66 (patch)
tree1ce3c9bed76a70e3386791796ea39916da6d5421 /test
parent828c49ae29fd318547d7bbe4e7fdc65da316e309 (diff)
parent9e105d483fa54c5f07a42b4c0fab40507f1fd9ec (diff)
downloademacs-841614c72272146fff1b9afa05d52150da6d6e66.tar.gz
Merge from origin/emacs-29
9e105d483fa Fix c-ts-mode indentation for statement after preproc (bu... a72a55e3e49 Fix c/c++-ts-mode's mode lighter 67befc1f5a5 Eglot: use shell-file-name in eglot--cmd (bug#61748) 1c7b2673bdd Avoid signaling errors in url-basic-auth when password is... 756225e3778 Fix wdired-tests on MS-Windows a137f71c67e Improvements to xwidget on macOS (bug#60703) 3f43a16bc63 ; Avoid byte-compilation warning in c-ts-mode.el
Diffstat (limited to 'test')
-rw-r--r--test/lisp/wdired-tests.el19
1 files changed, 17 insertions, 2 deletions
diff --git a/test/lisp/wdired-tests.el b/test/lisp/wdired-tests.el
index 897c6cd69a8..20caaff17c7 100644
--- a/test/lisp/wdired-tests.el
+++ b/test/lisp/wdired-tests.el
@@ -31,6 +31,10 @@
"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))
@@ -56,6 +60,7 @@ Partially modifying a file name should succeed."
"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)
@@ -106,6 +111,7 @@ only the name before the link arrow."
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)))
@@ -143,7 +149,11 @@ wdired-get-filename before and after editing."
(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))
@@ -176,6 +186,7 @@ wdired-get-filename before and after editing."
(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)
@@ -202,7 +213,11 @@ should be invisible again."
(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)