summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2013-09-16 15:20:44 -0400
committerGlenn Morris <rgm@gnu.org>2013-09-16 15:20:44 -0400
commit88302cbb9f988fd17604be8722731ba53dd1a27a (patch)
tree19ba724f162aeafbe7694826823ff1163b77ae65
parent504a03813b3d3984c27cf6cf3b87c0ba8d1d57a9 (diff)
downloademacs-88302cbb9f988fd17604be8722731ba53dd1a27a.tar.gz
* test/automated/eshell (eshell-test/for-name-shadow-loop): Tweak previous
-rw-r--r--test/automated/eshell.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/automated/eshell.el b/test/automated/eshell.el
index dad494b3238..643e83c6a76 100644
--- a/test/automated/eshell.el
+++ b/test/automated/eshell.el
@@ -51,6 +51,9 @@
(goto-char eshell-last-input-end)
(looking-at regexp))
+;; FIXME this does not return informative failure messages, just t or nil.
+;; It should return the expected buffer contents and the actual one,
+;; so that we can see what form ant failure took.
(defun eshell-command-result-p (text regexp &optional func)
"Insert a command at the end of the buffer."
(eshell-insert-command text func)
@@ -89,10 +92,10 @@
(ert-deftest eshell-test/for-name-shadow-loop () ; bug#15372
"Test `eshell-command-result' with a for loop using an env-var."
(let ((process-environment (cons "name=env-value" process-environment)))
- (should (equal (eshell-test-command-result "echo $name") "env-value"))
- (should (equal (eshell-test-command-result
- "for name in 3 { echo $name }") 3))
- (should (equal (eshell-test-command-result "echo $name") "env-value"))))
+ (with-temp-eshell
+ (should
+ (eshell-command-result-p "echo $name; for name in 3 { echo $name }; echo $name"
+ "env-value\n3\nenv-value\n")))))
(ert-deftest eshell-test/lisp-command-args ()
"Test `eshell-command-result' with elisp and trailing args.