; Fix Eshell tests
* test/lisp/eshell/eshell-tests.el (eshell-test/forward-arg): Add 'should' calls to check state. * test/lisp/eshell/em-extpipe-tests.el (em-extpipe-tests--deftest): Add 'should' calls and fix temp-buffer substitution.
This commit is contained in:
parent
ef3c410018
commit
279e3723b1
2 changed files with 17 additions and 17 deletions
|
@ -48,26 +48,29 @@
|
|||
;; 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>"
|
||||
(concat "#<buffer " (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))
|
||||
|
|
|
@ -162,16 +162,13 @@ This test uses a pipeline for the command."
|
|||
"Test moving across command arguments"
|
||||
(with-temp-eshell
|
||||
(eshell-insert-command "echo $(+ 1 (- 4 3)) \"alpha beta\" file" 'ignore)
|
||||
(let ((here (point)) begin valid)
|
||||
(let ((end (point)) begin)
|
||||
(beginning-of-line)
|
||||
(setq begin (point))
|
||||
(eshell-forward-argument 4)
|
||||
(setq valid (= here (point)))
|
||||
(should (= end (point)))
|
||||
(eshell-backward-argument 4)
|
||||
(prog1
|
||||
(and valid (= begin (point)))
|
||||
(beginning-of-line)
|
||||
(delete-region (point) (point-max))))))
|
||||
(should (= begin (point))))))
|
||||
|
||||
(ert-deftest eshell-test/queue-input ()
|
||||
"Test queuing command input.
|
||||
|
|
Loading…
Add table
Reference in a new issue