diff options
| author | Glenn Morris | 2013-09-16 15:20:44 -0400 |
|---|---|---|
| committer | Glenn Morris | 2013-09-16 15:20:44 -0400 |
| commit | 88302cbb9f988fd17604be8722731ba53dd1a27a (patch) | |
| tree | 19ba724f162aeafbe7694826823ff1163b77ae65 | |
| parent | 504a03813b3d3984c27cf6cf3b87c0ba8d1d57a9 (diff) | |
| download | emacs-88302cbb9f988fd17604be8722731ba53dd1a27a.tar.gz emacs-88302cbb9f988fd17604be8722731ba53dd1a27a.zip | |
* test/automated/eshell (eshell-test/for-name-shadow-loop): Tweak previous
| -rw-r--r-- | test/automated/eshell.el | 11 |
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 @@ | |||
| 51 | (goto-char eshell-last-input-end) | 51 | (goto-char eshell-last-input-end) |
| 52 | (looking-at regexp)) | 52 | (looking-at regexp)) |
| 53 | 53 | ||
| 54 | ;; FIXME this does not return informative failure messages, just t or nil. | ||
| 55 | ;; It should return the expected buffer contents and the actual one, | ||
| 56 | ;; so that we can see what form ant failure took. | ||
| 54 | (defun eshell-command-result-p (text regexp &optional func) | 57 | (defun eshell-command-result-p (text regexp &optional func) |
| 55 | "Insert a command at the end of the buffer." | 58 | "Insert a command at the end of the buffer." |
| 56 | (eshell-insert-command text func) | 59 | (eshell-insert-command text func) |
| @@ -89,10 +92,10 @@ | |||
| 89 | (ert-deftest eshell-test/for-name-shadow-loop () ; bug#15372 | 92 | (ert-deftest eshell-test/for-name-shadow-loop () ; bug#15372 |
| 90 | "Test `eshell-command-result' with a for loop using an env-var." | 93 | "Test `eshell-command-result' with a for loop using an env-var." |
| 91 | (let ((process-environment (cons "name=env-value" process-environment))) | 94 | (let ((process-environment (cons "name=env-value" process-environment))) |
| 92 | (should (equal (eshell-test-command-result "echo $name") "env-value")) | 95 | (with-temp-eshell |
| 93 | (should (equal (eshell-test-command-result | 96 | (should |
| 94 | "for name in 3 { echo $name }") 3)) | 97 | (eshell-command-result-p "echo $name; for name in 3 { echo $name }; echo $name" |
| 95 | (should (equal (eshell-test-command-result "echo $name") "env-value")))) | 98 | "env-value\n3\nenv-value\n"))))) |
| 96 | 99 | ||
| 97 | (ert-deftest eshell-test/lisp-command-args () | 100 | (ert-deftest eshell-test/lisp-command-args () |
| 98 | "Test `eshell-command-result' with elisp and trailing args. | 101 | "Test `eshell-command-result' with elisp and trailing args. |