summaryrefslogtreecommitdiff
path: root/test/lisp/eshell/eshell-tests.el
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-01-22 18:54:55 -0700
committerLars Ingebrigtsen <larsi@gnus.org>2022-01-24 21:45:00 +0100
commit42aef82a2b0d7b464a97fb0a50ae00501d7b4708 (patch)
treeb08fba36f765496465a5d1354ec15c7f3e2bb101 /test/lisp/eshell/eshell-tests.el
parent1693423fd74d882f7e682a65136c1111e253058a (diff)
downloademacs-42aef82a2b0d7b464a97fb0a50ae00501d7b4708.tar.gz
Rework eshell-match-result for testing asynchronous commands
When using eshell-match-result via eshell-command-result-p to examine the output of asynchronous Eshell commands, a newly emitted prompt is included in the text against which the regexp is matched. This makes it awkward to match against the whole output; for example, to check whether it is empty. Rework the function to exclude the prompt. * test/lisp/eshell/eshell-tests-helpers.el (eshell-match-result): Exclude any newly emitted prompt from the text against which the regexp is matched. Additionally, the function no longer moves point. * test/lisp/eshell/eshell-tests.el (eshell-test/flush-output): Update and simplify test given how eshell-match-result no longer moves point.
Diffstat (limited to 'test/lisp/eshell/eshell-tests.el')
-rw-r--r--test/lisp/eshell/eshell-tests.el5
1 files changed, 2 insertions, 3 deletions
diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el
index 6aeefdfde21..542815df809 100644
--- a/test/lisp/eshell/eshell-tests.el
+++ b/test/lisp/eshell/eshell-tests.el
@@ -232,9 +232,8 @@ chars"
(with-temp-eshell
(eshell-insert-command "echo alpha")
(eshell-kill-output)
- (eshell-match-result (regexp-quote "*** output flushed ***\n"))
- (should (forward-line))
- (should (= (point) eshell-last-output-start))))
+ (eshell-match-result
+ (concat "^" (regexp-quote "*** output flushed ***\n") "$"))))
(ert-deftest eshell-test/run-old-command ()
"Re-run an old command"