diff options
author | Jim Porter <jporterbugs@gmail.com> | 2022-08-13 20:31:11 -0700 |
---|---|---|
committer | Jim Porter <jporterbugs@gmail.com> | 2022-08-15 20:40:27 -0700 |
commit | 07b8fb197a3057a3419be0335236547e4d7a326b (patch) | |
tree | 52b631c5f3cc6370223e1d9f7920b7b3af37f197 /test/lisp/eshell/em-alias-tests.el | |
parent | 1973d4ac1b613bdd6c70e1ef2bac97b538fbb2ed (diff) | |
download | emacs-07b8fb197a3057a3419be0335236547e4d7a326b.tar.gz emacs-07b8fb197a3057a3419be0335236547e4d7a326b.tar.bz2 emacs-07b8fb197a3057a3419be0335236547e4d7a326b.zip |
Provide ERT explainer for 'eshell-match-command-output'
This was formerly named 'eshell-command-result-p', but "result" isn't
quite the right terminology, since this function specifically tested
the output of a command, not its Lisp result (as
'eshell-command-result' would return).
* test/lisp/eshell/eshell-tests-helpers.el (eshell-insert-command):
Provide a more-complete docstring.
(eshell-match-result): Rename to...
(eshell-match-output): ... this.
(eshell-match-output--explainer): New function.
(eshell-command-result-p): Rename to...
(eshell-match-command-output): ... this.
* test/lisp/eshell/em-alias-tests.el
* test/lisp/eshell/em-dirs-tests.el
* test/lisp/eshell/em-extpipe-tests.el
* test/lisp/eshell/em-script-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-helpers.el
* test/lisp/eshell/eshell-tests.el: Use 'eshell-match-command-output'.
Diffstat (limited to 'test/lisp/eshell/em-alias-tests.el')
-rw-r--r-- | test/lisp/eshell/em-alias-tests.el | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/test/lisp/eshell/em-alias-tests.el b/test/lisp/eshell/em-alias-tests.el index 497159e3460..aca622220e3 100644 --- a/test/lisp/eshell/em-alias-tests.el +++ b/test/lisp/eshell/em-alias-tests.el @@ -38,50 +38,50 @@ "Test a simple alias with no arguments" (with-temp-eshell (eshell-insert-command "alias say-hi 'echo hi'") - (eshell-command-result-p "say-hi" "hi\n") - (eshell-command-result-p "say-hi bye" "hi\n"))) + (eshell-match-command-output "say-hi" "hi\n") + (eshell-match-command-output "say-hi bye" "hi\n"))) (ert-deftest em-alias-test/alias-arg-vars () "Test alias with $0, $1, ... variables" (with-temp-eshell (eshell-insert-command "alias show-args 'printnl $0 \"$1 $2\"'") - (eshell-command-result-p "show-args one two" "show-args\none two\n"))) + (eshell-match-command-output "show-args one two" "show-args\none two\n"))) (ert-deftest em-alias-test/alias-arg-vars-indices () "Test alias with $1, $2, ... variables using indices" (with-temp-eshell (eshell-insert-command "alias funny-sum '+ $1[0] $2[1]'") - (eshell-command-result-p "funny-sum (list 1 2) (list 3 4)" - "5\n"))) + (eshell-match-command-output "funny-sum (list 1 2) (list 3 4)" + "5\n"))) (ert-deftest em-alias-test/alias-arg-vars-split-indices () "Test alias with $0, $1, ... variables using split indices" (with-temp-eshell (eshell-insert-command "alias my-prefix 'echo $0[- 0]'") - (eshell-command-result-p "my-prefix" - "my\n") + (eshell-match-command-output "my-prefix" + "my\n") (eshell-insert-command "alias funny-sum '+ $1[: 0] $2[: 1]'") - (eshell-command-result-p "funny-sum 1:2 3:4" - "5\n"))) + (eshell-match-command-output "funny-sum 1:2 3:4" + "5\n"))) (ert-deftest em-alias-test/alias-all-args-var () "Test alias with the $* variable" (with-temp-eshell (eshell-insert-command "alias show-all-args 'printnl $*'") - (eshell-command-result-p "show-all-args" "\\`\\'") - (eshell-command-result-p "show-all-args a" "a\n") - (eshell-command-result-p "show-all-args a b c" "a\nb\nc\n"))) + (eshell-match-command-output "show-all-args" "\\`\\'") + (eshell-match-command-output "show-all-args a" "a\n") + (eshell-match-command-output "show-all-args a b c" "a\nb\nc\n"))) (ert-deftest em-alias-test/alias-all-args-var-indices () "Test alias with the $* variable using indices" (with-temp-eshell (eshell-insert-command "alias add-pair '+ $*[0] $*[1]'") - (eshell-command-result-p "add-pair 1 2" "3\n"))) + (eshell-match-command-output "add-pair 1 2" "3\n"))) (ert-deftest em-alias-test/alias-all-args-var-split-indices () "Test alias with the $* variable using split indices" (with-temp-eshell (eshell-insert-command "alias add-funny-pair '+ $*[0][: 0] $*[1][: 1]'") - (eshell-command-result-p "add-funny-pair 1:2 3:4" "5\n"))) + (eshell-match-command-output "add-funny-pair 1:2 3:4" "5\n"))) ;; em-alias-tests.el ends here |