]> git.eshelyaron.com Git - emacs.git/commit
Rework eshell-match-result for testing asynchronous commands
authorSean Whitton <spwhitton@spwhitton.name>
Sun, 23 Jan 2022 01:54:55 +0000 (18:54 -0700)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 24 Jan 2022 20:45:00 +0000 (21:45 +0100)
commit42aef82a2b0d7b464a97fb0a50ae00501d7b4708
treeb08fba36f765496465a5d1354ec15c7f3e2bb101
parent1693423fd74d882f7e682a65136c1111e253058a
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.
test/lisp/eshell/eshell-tests-helpers.el
test/lisp/eshell/eshell-tests.el