emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117386: * automated/tramp-tests.el (tramp-test26-pr


From: Michael Albinus
Subject: [Emacs-diffs] trunk r117386: * automated/tramp-tests.el (tramp-test26-process-file): Extend test
Date: Tue, 24 Jun 2014 07:48:43 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117386
revision-id: address@hidden
parent: address@hidden
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Tue 2014-06-24 09:48:19 +0200
message:
  * automated/tramp-tests.el (tramp-test26-process-file): Extend test
  according to Bug#17815.
modified:
  test/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-8588
  test/automated/tramp-tests.el  tramptests.el-20131105142319-d9zp3oprkpxj5v1e-1
=== modified file 'test/ChangeLog'
--- a/test/ChangeLog    2014-06-21 19:45:59 +0000
+++ b/test/ChangeLog    2014-06-24 07:48:19 +0000
@@ -1,3 +1,8 @@
+2014-06-24  Michael Albinus  <address@hidden>
+
+       * automated/tramp-tests.el (tramp-test26-process-file): Extend test
+       according to Bug#17815.
+
 2014-06-21  Fabián Ezequiel Gallina  <address@hidden>
 
        * automated/python-tests.el (python-util-strip-string-1): New test.

=== modified file 'test/automated/tramp-tests.el'
--- a/test/automated/tramp-tests.el     2014-06-15 15:56:58 +0000
+++ b/test/automated/tramp-tests.el     2014-06-24 07:48:19 +0000
@@ -1246,9 +1246,10 @@
      (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 @@
          (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))))
-           ;; `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)))))
+           (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%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 ()


reply via email to

[Prev in Thread] Current Thread [Next in Thread]