; 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".
This commit is contained in:
@@ -767,8 +767,11 @@ hence another buffer should be returned."
|
||||
(should (get-buffer-window errbuf))
|
||||
(should-not (equal (buffer-name buf) (file-name-nondirectory name)))
|
||||
(with-current-buffer errbuf
|
||||
(should (equal (funcall ls-err (file-name-nondirectory name))
|
||||
(buffer-string))))
|
||||
;; The error message may report e.g. "/bin/ls" even though the
|
||||
;; value of `insert-directory-program' is "ls", so we can't
|
||||
;; test with `equal'.
|
||||
(should (string-match-p (funcall ls-err (file-name-nondirectory name))
|
||||
(buffer-string))))
|
||||
(kill-buffer errbuf))
|
||||
(delete-directory dir t))))
|
||||
|
||||
|
||||
@@ -1048,8 +1048,11 @@ unquoted file names."
|
||||
(concat (car errlist) fn (cadr errlist))))))
|
||||
(should errbuf)
|
||||
(with-current-buffer errbuf
|
||||
(should (equal (funcall ls-err nospecial-dir)
|
||||
(buffer-string))))
|
||||
;; The error message may report e.g. "/bin/ls" even though the
|
||||
;; value of `insert-directory-program' is "ls", so we can't
|
||||
;; test with `equal'.
|
||||
(should (string-match-p (funcall ls-err nospecial-dir)
|
||||
(buffer-string))))
|
||||
(kill-buffer errbuf)))))
|
||||
|
||||
(ert-deftest files-tests-file-name-non-special-insert-file-contents ()
|
||||
|
||||
Reference in New Issue
Block a user