Make shell-command tests fit for tcsh.
* test/lisp/simple-tests.el (with-shell-command-dont-erase-buffer): Fix debug spec. Format command to run also under tcsh. (simple-tests-shell-command-39067) (simple-tests-shell-command-dont-erase-buffer): Quote newline in string.
This commit is contained in:
parent
68f4a740a1
commit
f0b9f18457
1 changed files with 4 additions and 4 deletions
|
@ -715,7 +715,7 @@ See Bug#21722."
|
||||||
;;; Tests for shell-command-dont-erase-buffer
|
;;; Tests for shell-command-dont-erase-buffer
|
||||||
|
|
||||||
(defmacro with-shell-command-dont-erase-buffer (str output-buffer-is-current &rest body)
|
(defmacro with-shell-command-dont-erase-buffer (str output-buffer-is-current &rest body)
|
||||||
(declare (debug (form &body)) (indent 2))
|
(declare (debug (sexp form body)) (indent 2))
|
||||||
(let ((expected (make-symbol "expected"))
|
(let ((expected (make-symbol "expected"))
|
||||||
(command (make-symbol "command"))
|
(command (make-symbol "command"))
|
||||||
(caller-buf (make-symbol "caller-buf"))
|
(caller-buf (make-symbol "caller-buf"))
|
||||||
|
@ -724,7 +724,7 @@ See Bug#21722."
|
||||||
(,output-buf (if ,output-buffer-is-current ,caller-buf
|
(,output-buf (if ,output-buffer-is-current ,caller-buf
|
||||||
(generate-new-buffer "output-buf")))
|
(generate-new-buffer "output-buf")))
|
||||||
(emacs (expand-file-name invocation-name invocation-directory))
|
(emacs (expand-file-name invocation-name invocation-directory))
|
||||||
(,command (format "%s -Q --batch --eval \"(princ \\\"%s\\\")\""
|
(,command (format "%s -Q --batch --eval '(princ %S)'"
|
||||||
emacs ,str))
|
emacs ,str))
|
||||||
(inhibit-message t))
|
(inhibit-message t))
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
|
@ -745,7 +745,7 @@ See Bug#21722."
|
||||||
|
|
||||||
(ert-deftest simple-tests-shell-command-39067 ()
|
(ert-deftest simple-tests-shell-command-39067 ()
|
||||||
"The output buffer is erased or not according to `shell-command-dont-erase-buffer'."
|
"The output buffer is erased or not according to `shell-command-dont-erase-buffer'."
|
||||||
(let ((str "foo\n"))
|
(let ((str "foo\\n"))
|
||||||
(dolist (output-current '(t nil))
|
(dolist (output-current '(t nil))
|
||||||
(with-shell-command-dont-erase-buffer str output-current
|
(with-shell-command-dont-erase-buffer str output-current
|
||||||
(let ((expected (cond ((eq shell-command-dont-erase-buffer 'erase) str)
|
(let ((expected (cond ((eq shell-command-dont-erase-buffer 'erase) str)
|
||||||
|
@ -757,7 +757,7 @@ See Bug#21722."
|
||||||
|
|
||||||
(ert-deftest simple-tests-shell-command-dont-erase-buffer ()
|
(ert-deftest simple-tests-shell-command-dont-erase-buffer ()
|
||||||
"The point is set at the expected position after execution of the command."
|
"The point is set at the expected position after execution of the command."
|
||||||
(let* ((str "foo\n")
|
(let* ((str "foo\\n")
|
||||||
(expected-point `((beg-last-out . ,(1+ (length str)))
|
(expected-point `((beg-last-out . ,(1+ (length str)))
|
||||||
(end-last-out . ,(1+ (* 2 (length str))))
|
(end-last-out . ,(1+ (* 2 (length str))))
|
||||||
(save-point . 1))))
|
(save-point . 1))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue