diff options
Diffstat (limited to 'test/lisp/eshell/em-extpipe-tests.el')
-rw-r--r-- | test/lisp/eshell/em-extpipe-tests.el | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/test/lisp/eshell/em-extpipe-tests.el b/test/lisp/eshell/em-extpipe-tests.el index 668dcba7c44..610e3d41524 100644 --- a/test/lisp/eshell/em-extpipe-tests.el +++ b/test/lisp/eshell/em-extpipe-tests.el @@ -42,32 +42,37 @@ (shell-command-switch "-c")) ;; Strip `eshell-trap-errors'. (should (equal ,expected - (cadr (eshell-parse-command input)))))) + (cadadr (eshell-parse-command input)))))) (with-substitute-for-temp (&rest body) ;; Substitute name of an actual temporary file and/or ;; buffer into `input'. The substitution logic is ;; appropriate for only the use we put it to in this file. `(ert-with-temp-file temp - (let ((temp-buffer (generate-new-buffer " *temp*" t))) + (let ((temp-buffer (generate-new-buffer " *tmp*" t))) (unwind-protect (let ((input (replace-regexp-in-string "temp\\([^>]\\|\\'\\)" temp - (string-replace "#<buffer temp>" - (buffer-name temp-buffer) - input)))) + (string-replace + "#<buffer temp>" + (format "#<buffer %s>" + (eshell-quote-argument + (buffer-name temp-buffer))) + input)))) ,@body) (when (buffer-name temp-buffer) (kill-buffer temp-buffer)))))) (temp-should-string= (expected) - `(string= ,expected (string-trim-right - (with-temp-buffer - (insert-file-contents temp) - (buffer-string))))) + `(should (string= ,expected + (string-trim-right + (with-temp-buffer + (insert-file-contents temp) + (buffer-string)))))) (temp-buffer-should-string= (expected) - `(string= ,expected (string-trim-right - (with-current-buffer temp-buffer - (buffer-string)))))) + `(should (string= ,expected + (string-trim-right + (with-current-buffer temp-buffer + (buffer-string))))))) (skip-unless shell-file-name) (skip-unless shell-command-switch) (skip-unless (executable-find shell-file-name)) @@ -107,7 +112,7 @@ '(progn (ignore (eshell-set-output-handle 1 'overwrite - (get-buffer-create "temp"))) + (eshell-get-buffer "temp"))) (eshell-named-command "sh" (list "-c" "echo \"bar\" | rev")))) (with-substitute-for-temp @@ -130,7 +135,7 @@ '(progn (ignore (eshell-set-output-handle 1 'overwrite - (get-buffer-create "quux"))) + (eshell-get-buffer "quux"))) (ignore (eshell-set-output-handle 1 'append (get-process "other"))) |