aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus <[email protected]>2014-06-24 09:48:19 +0200
committerMichael Albinus <[email protected]>2014-06-24 09:48:19 +0200
commitb6266364bd99d506753fc3b78dda69de23bdc5d6 (patch)
tree9213727d9c478b3f5d16667bb97844c8103a03f2 /test
parent131a3a12c4b0171c71c122c3330f85fc19e9bb8f (diff)
* automated/tramp-tests.el (tramp-test26-process-file): Extend test
according to Bug#17815.
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog5
-rw-r--r--test/automated/tramp-tests.el27
2 files changed, 23 insertions, 9 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index b90f47631b..08492dd4c8 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2014-06-24 Michael Albinus <[email protected]>
+
+ * automated/tramp-tests.el (tramp-test26-process-file): Extend test
+ according to Bug#17815.
+
2014-06-21 Fabián Ezequiel Gallina <[email protected]>
* automated/python-tests.el (python-util-strip-string-1): New test.
diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el
index d30a5b0c9a..b010ab467f 100644
--- a/test/automated/tramp-tests.el
+++ b/test/automated/tramp-tests.el
@@ -1246,9 +1246,10 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory)
'(tramp-gvfs-file-name-handler tramp-smb-file-name-handler))))
- (let ((tmp-name (tramp--test-make-temp-name))
- (default-directory tramp-test-temporary-file-directory)
- kill-buffer-query-functions)
+ (let* ((tmp-name (tramp--test-make-temp-name))
+ (fnnd (file-name-nondirectory tmp-name))
+ (default-directory tramp-test-temporary-file-directory)
+ kill-buffer-query-functions)
(unwind-protect
(progn
;; We cannot use "/bin/true" and "/bin/false"; those paths
@@ -1259,17 +1260,25 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(with-temp-buffer
(write-region "foo" nil tmp-name)
(should (file-exists-p tmp-name))
- (should
- (zerop
- (process-file "ls" nil t nil (file-name-nondirectory tmp-name))))
+ (should (zerop (process-file "ls" nil t nil fnnd)))
+ ;; `ls' could produce colorized output.
+ (goto-char (point-min))
+ (while (re-search-forward tramp-color-escape-sequence-regexp nil t)
+ (replace-match "" nil nil))
+ (should (string-equal (format "%s\n" fnnd) (buffer-string)))
+ (should-not (get-buffer-window (current-buffer) t))
+
+ ;; Second run. The output must be appended.
+ (should (zerop (process-file "ls" nil t t fnnd)))
;; `ls' could produce colorized output.
(goto-char (point-min))
(while (re-search-forward tramp-color-escape-sequence-regexp nil t)
(replace-match "" nil nil))
(should
- (string-equal
- (format "%s\n" (file-name-nondirectory tmp-name))
- (buffer-string)))))
+ (string-equal (format "%s\n%s\n" fnnd fnnd) (buffer-string)))
+ ;; A non-nil DISPLAY must not raise the buffer.
+ (should-not (get-buffer-window (current-buffer) t))))
+
(ignore-errors (delete-file tmp-name)))))
(ert-deftest tramp-test27-start-file-process ()