[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r116309: * automated/tramp-tests.el (tramp-test26-pr
From: |
Michael Albinus |
Subject: |
[Emacs-diffs] trunk r116309: * automated/tramp-tests.el (tramp-test26-process-file): Improve test. |
Date: |
Fri, 07 Feb 2014 15:47:30 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 116309
revision-id: address@hidden
parent: address@hidden
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Fri 2014-02-07 16:47:18 +0100
message:
* automated/tramp-tests.el (tramp-test26-process-file): Improve test.
(tramp-test27-start-file-process): Use "_p" as argument of lambda.
(tramp-test28-shell-command): Improve `shell-command' test. Add
`async-shell-command' tests.
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-02-04 11:41:20 +0000
+++ b/test/ChangeLog 2014-02-07 15:47:18 +0000
@@ -1,3 +1,10 @@
+2014-02-07 Michael Albinus <address@hidden>
+
+ * automated/tramp-tests.el (tramp-test26-process-file): Improve test.
+ (tramp-test27-start-file-process): Use "_p" as argument of lambda.
+ (tramp-test28-shell-command): Improve `shell-command' test. Add
+ `async-shell-command' tests.
+
2014-02-04 Michael Albinus <address@hidden>
* automated/file-notify-tests.el (file-notify--wait-for-events):
=== modified file 'test/automated/tramp-tests.el'
--- a/test/automated/tramp-tests.el 2014-01-01 07:43:34 +0000
+++ b/test/automated/tramp-tests.el 2014-02-07 15:47:18 +0000
@@ -1084,8 +1084,14 @@
(should-not (zerop (process-file "binary-does-not-exist")))
(with-temp-buffer
(write-region "foo" nil tmp-name)
- (should (zerop (process-file "ls" nil t)))
- (should (> (point-max) (point-min)))))
+ (should (file-exists-p tmp-name))
+ (should
+ (zerop
+ (process-file "ls" nil t nil (file-name-nondirectory tmp-name))))
+ (should
+ (string-equal
+ (format "%s\n" (file-name-nondirectory tmp-name))
+ (buffer-string)))))
(ignore-errors (delete-file tmp-name)))))
(ert-deftest tramp-test27-start-file-process ()
@@ -1130,7 +1136,7 @@
(should (processp proc))
(should (equal (process-status proc) 'run))
(set-process-filter
- proc (lambda (p s) (should (string-equal s "foo"))))
+ proc (lambda (_p s) (should (string-equal s "foo"))))
(process-send-string proc "foo")
(process-send-eof proc)
(accept-process-output proc 1))
@@ -1147,9 +1153,39 @@
(default-directory tramp-test-temporary-file-directory))
(unwind-protect
(with-temp-buffer
- (write-region "foo" nil tmp-name)
- (shell-command "ls" (current-buffer))
- (should (> (point-max) (point-min))))
+ (write-region "foo" nil tmp-name nil)
+ (should (file-exists-p tmp-name))
+ (shell-command
+ (format "ls %s" (file-name-nondirectory tmp-name)) (current-buffer))
+ (should
+ (string-equal
+ (format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string))))
+ (ignore-errors (delete-file tmp-name)))
+
+ (unwind-protect
+ (with-temp-buffer
+ (write-region "foo" nil tmp-name nil)
+ (should (file-exists-p tmp-name))
+ (async-shell-command
+ (format "ls %s" (file-name-nondirectory tmp-name)) (current-buffer))
+ (sit-for 1 'nodisplay)
+ (should
+ (string-equal
+ (format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string))))
+ (ignore-errors (delete-file tmp-name)))
+
+ (unwind-protect
+ (with-temp-buffer
+ (write-region "foo" nil tmp-name)
+ (should (file-exists-p tmp-name))
+ (async-shell-command "read line; ls $line" (current-buffer))
+ (process-send-string
+ (get-buffer-process (current-buffer))
+ (format "%s\n" (file-name-nondirectory tmp-name)))
+ (sit-for 1 'nodisplay)
+ (should
+ (string-equal
+ (format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string))))
(ignore-errors (delete-file tmp-name)))))
(ert-deftest tramp-test29-utf8 ()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r116309: * automated/tramp-tests.el (tramp-test26-process-file): Improve test.,
Michael Albinus <=