diff options
| author | Stephen Berman | 2026-04-11 15:40:40 +0200 |
|---|---|---|
| committer | Stephen Berman | 2026-04-11 15:40:40 +0200 |
| commit | ee9b2db1cf036d6f511d7e6eea0189073076e7c0 (patch) | |
| tree | cff562f158744e12b5045687375f11c9e3eb38f3 | |
| parent | 15f1b565a2e7a7cb68e662dfc852e840db6a954b (diff) | |
| download | emacs-ee9b2db1cf036d6f511d7e6eea0189073076e7c0.tar.gz emacs-ee9b2db1cf036d6f511d7e6eea0189073076e7c0.zip | |
; Fix last change to 'ls' error message tests
* test/lisp/dired-tests.el (dired-test-ls-error-message):
* test/lisp/files-tests.el
(files-tests-file-name-non-special-insert-directory): Use
`string-match-p' instead of `equal' because the error message may
report e.g. "/bin/ls" even though the value of
`insert-directory-program' is "ls".
| -rw-r--r-- | test/lisp/dired-tests.el | 7 | ||||
| -rw-r--r-- | test/lisp/files-tests.el | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el index 35795825365..f5f92fd6485 100644 --- a/test/lisp/dired-tests.el +++ b/test/lisp/dired-tests.el | |||
| @@ -767,8 +767,11 @@ hence another buffer should be returned." | |||
| 767 | (should (get-buffer-window errbuf)) | 767 | (should (get-buffer-window errbuf)) |
| 768 | (should-not (equal (buffer-name buf) (file-name-nondirectory name))) | 768 | (should-not (equal (buffer-name buf) (file-name-nondirectory name))) |
| 769 | (with-current-buffer errbuf | 769 | (with-current-buffer errbuf |
| 770 | (should (equal (funcall ls-err (file-name-nondirectory name)) | 770 | ;; The error message may report e.g. "/bin/ls" even though the |
| 771 | (buffer-string)))) | 771 | ;; value of `insert-directory-program' is "ls", so we can't |
| 772 | ;; test with `equal'. | ||
| 773 | (should (string-match-p (funcall ls-err (file-name-nondirectory name)) | ||
| 774 | (buffer-string)))) | ||
| 772 | (kill-buffer errbuf)) | 775 | (kill-buffer errbuf)) |
| 773 | (delete-directory dir t)))) | 776 | (delete-directory dir t)))) |
| 774 | 777 | ||
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index 7b049af7070..037e354d841 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el | |||
| @@ -1048,8 +1048,11 @@ unquoted file names." | |||
| 1048 | (concat (car errlist) fn (cadr errlist)))))) | 1048 | (concat (car errlist) fn (cadr errlist)))))) |
| 1049 | (should errbuf) | 1049 | (should errbuf) |
| 1050 | (with-current-buffer errbuf | 1050 | (with-current-buffer errbuf |
| 1051 | (should (equal (funcall ls-err nospecial-dir) | 1051 | ;; The error message may report e.g. "/bin/ls" even though the |
| 1052 | (buffer-string)))) | 1052 | ;; value of `insert-directory-program' is "ls", so we can't |
| 1053 | ;; test with `equal'. | ||
| 1054 | (should (string-match-p (funcall ls-err nospecial-dir) | ||
| 1055 | (buffer-string)))) | ||
| 1053 | (kill-buffer errbuf))))) | 1056 | (kill-buffer errbuf))))) |
| 1054 | 1057 | ||
| 1055 | (ert-deftest files-tests-file-name-non-special-insert-file-contents () | 1058 | (ert-deftest files-tests-file-name-non-special-insert-file-contents () |