diff options
author | Jim Porter <jporterbugs@gmail.com> | 2022-08-14 13:44:04 -0700 |
---|---|---|
committer | Jim Porter <jporterbugs@gmail.com> | 2022-08-15 20:40:27 -0700 |
commit | c1f1be4b73072440518f02356998cf58ba127ebd (patch) | |
tree | c56338d1c699bb6ca1cbdf39a13fd939f9d0ff3a /test/lisp/eshell/eshell-tests.el | |
parent | 07b8fb197a3057a3419be0335236547e4d7a326b (diff) | |
download | emacs-c1f1be4b73072440518f02356998cf58ba127ebd.tar.gz |
Add 'eshell-command-result-equal' with an ERT explainer
* test/lisp/eshell/eshell-tests-helpers.el
(eshell-command-result--equal, eshell-command-result--equal-explainer)
(eshell-command-result-equal): New functions.
* test/lisp/eshell/em-basic-tests.el
* test/lisp/eshell/em-dirs-tests.el
* test/lisp/eshell/esh-cmd-tests.el
* test/lisp/eshell/esh-proc-tests.el
* test/lisp/eshell/esh-var-tests.el
* test/lisp/eshell/eshell-tests.el: Use 'eshell-command-result-equal'.
Diffstat (limited to 'test/lisp/eshell/eshell-tests.el')
-rw-r--r-- | test/lisp/eshell/eshell-tests.el | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index c7a9516bea4..1845dba2809 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -83,28 +83,27 @@ (dolist (template '("echo {%s} | *cat" "echo ${%s} | *cat" "*cat $<%s> | *cat")) - (should (equal (eshell-test-command-result - (format template "echo $eshell-in-pipeline-p")) - nil)) - (should (equal (eshell-test-command-result - (format template "echo | echo $eshell-in-pipeline-p")) - "last")) - (should (equal (eshell-test-command-result - (format template "echo $eshell-in-pipeline-p | echo")) - "first")) - (should (equal (eshell-test-command-result - (format template - "echo | echo $eshell-in-pipeline-p | echo")) - "t")))) + (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"))) (ert-deftest eshell-test/lisp-reset-in-pipeline () "Check that interpolated Lisp forms reset `eshell-in-pipeline-p'." (skip-unless (executable-find "cat")) (dolist (template '("echo (%s) | *cat" "echo $(%s) | *cat")) - (should (equal (eshell-test-command-result - (format template "format \"%s\" eshell-in-pipeline-p")) - "nil")))) + (eshell-command-result-equal + (format template "format \"%s\" eshell-in-pipeline-p") + "nil"))) (ert-deftest eshell-test/redirect-buffer () "Check that piping to a buffer works" |