From b23948f4645fa3db3d309e2f1197ff389264b97c Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Tue, 6 Sep 2022 11:36:58 -0700 Subject: [PATCH] Improve robustness of an Eshell regression test * test/lisp/eshell/eshell-tests.el (eshell-test/subcommand-reset-in-pipeline): Use 'eshell-match-command-output' to check result. Ref: https://lists.gnu.org/archive/html/emacs-devel/2022-09/msg00314.html --- test/lisp/eshell/eshell-tests.el | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index d5112146c2..2dc996e923 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -83,18 +83,19 @@ eshell-test/subcommand-reset-in-pipeline (dolist (template '("echo {%s} | *cat" "echo ${%s} | *cat" "*cat $<%s> | *cat")) - (eshell-command-result-equal - (format template "echo $eshell-in-pipeline-p") - nil) - (eshell-command-result-equal - (format template "echo | echo $eshell-in-pipeline-p") - "last") - (eshell-command-result-equal - (format template "echo $eshell-in-pipeline-p | echo") - "first") - (eshell-command-result-equal - (format template "echo | echo $eshell-in-pipeline-p | echo") - "t"))) + (with-temp-eshell + (eshell-match-command-output + (format template "echo $eshell-in-pipeline-p") + "\\`\\'") + (eshell-match-command-output + (format template "echo | echo $eshell-in-pipeline-p") + "\\`last") + (eshell-match-command-output + (format template "echo $eshell-in-pipeline-p | echo") + "\\`first") + (eshell-match-command-output + (format template "echo | echo $eshell-in-pipeline-p | echo") + "\\`t")))) (ert-deftest eshell-test/lisp-reset-in-pipeline () "Check that interpolated Lisp forms reset `eshell-in-pipeline-p'." -- 2.25.1