aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2014-02-07 16:47:18 +0100
committerMichael Albinus2014-02-07 16:47:18 +0100
commitcad6dfb67f541abaefb5d0f9784e660f39b9b645 (patch)
tree453613936663a6f38ce621b9cc99a3ecd53328b9
parente255a703761c1a10b6363ebb617ce89605b9062b (diff)
downloademacs-cad6dfb67f541abaefb5d0f9784e660f39b9b645.tar.gz
emacs-cad6dfb67f541abaefb5d0f9784e660f39b9b645.zip
* 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.
-rw-r--r--test/ChangeLog7
-rw-r--r--test/automated/tramp-tests.el48
2 files changed, 49 insertions, 6 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 597782da416..e3902c02477 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,10 @@
12014-02-07 Michael Albinus <michael.albinus@gmx.de>
2
3 * automated/tramp-tests.el (tramp-test26-process-file): Improve test.
4 (tramp-test27-start-file-process): Use "_p" as argument of lambda.
5 (tramp-test28-shell-command): Improve `shell-command' test. Add
6 `async-shell-command' tests.
7
12014-02-04 Michael Albinus <michael.albinus@gmx.de> 82014-02-04 Michael Albinus <michael.albinus@gmx.de>
2 9
3 * automated/file-notify-tests.el (file-notify--wait-for-events): 10 * automated/file-notify-tests.el (file-notify--wait-for-events):
diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el
index f038d687e34..182dc4bdfb7 100644
--- a/test/automated/tramp-tests.el
+++ b/test/automated/tramp-tests.el
@@ -1084,8 +1084,14 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
1084 (should-not (zerop (process-file "binary-does-not-exist"))) 1084 (should-not (zerop (process-file "binary-does-not-exist")))
1085 (with-temp-buffer 1085 (with-temp-buffer
1086 (write-region "foo" nil tmp-name) 1086 (write-region "foo" nil tmp-name)
1087 (should (zerop (process-file "ls" nil t))) 1087 (should (file-exists-p tmp-name))
1088 (should (> (point-max) (point-min))))) 1088 (should
1089 (zerop
1090 (process-file "ls" nil t nil (file-name-nondirectory tmp-name))))
1091 (should
1092 (string-equal
1093 (format "%s\n" (file-name-nondirectory tmp-name))
1094 (buffer-string)))))
1089 (ignore-errors (delete-file tmp-name))))) 1095 (ignore-errors (delete-file tmp-name)))))
1090 1096
1091(ert-deftest tramp-test27-start-file-process () 1097(ert-deftest tramp-test27-start-file-process ()
@@ -1130,7 +1136,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
1130 (should (processp proc)) 1136 (should (processp proc))
1131 (should (equal (process-status proc) 'run)) 1137 (should (equal (process-status proc) 'run))
1132 (set-process-filter 1138 (set-process-filter
1133 proc (lambda (p s) (should (string-equal s "foo")))) 1139 proc (lambda (_p s) (should (string-equal s "foo"))))
1134 (process-send-string proc "foo") 1140 (process-send-string proc "foo")
1135 (process-send-eof proc) 1141 (process-send-eof proc)
1136 (accept-process-output proc 1)) 1142 (accept-process-output proc 1))
@@ -1147,9 +1153,39 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
1147 (default-directory tramp-test-temporary-file-directory)) 1153 (default-directory tramp-test-temporary-file-directory))
1148 (unwind-protect 1154 (unwind-protect
1149 (with-temp-buffer 1155 (with-temp-buffer
1150 (write-region "foo" nil tmp-name) 1156 (write-region "foo" nil tmp-name nil)
1151 (shell-command "ls" (current-buffer)) 1157 (should (file-exists-p tmp-name))
1152 (should (> (point-max) (point-min)))) 1158 (shell-command
1159 (format "ls %s" (file-name-nondirectory tmp-name)) (current-buffer))
1160 (should
1161 (string-equal
1162 (format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string))))
1163 (ignore-errors (delete-file tmp-name)))
1164
1165 (unwind-protect
1166 (with-temp-buffer
1167 (write-region "foo" nil tmp-name nil)
1168 (should (file-exists-p tmp-name))
1169 (async-shell-command
1170 (format "ls %s" (file-name-nondirectory tmp-name)) (current-buffer))
1171 (sit-for 1 'nodisplay)
1172 (should
1173 (string-equal
1174 (format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string))))
1175 (ignore-errors (delete-file tmp-name)))
1176
1177 (unwind-protect
1178 (with-temp-buffer
1179 (write-region "foo" nil tmp-name)
1180 (should (file-exists-p tmp-name))
1181 (async-shell-command "read line; ls $line" (current-buffer))
1182 (process-send-string
1183 (get-buffer-process (current-buffer))
1184 (format "%s\n" (file-name-nondirectory tmp-name)))
1185 (sit-for 1 'nodisplay)
1186 (should
1187 (string-equal
1188 (format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string))))
1153 (ignore-errors (delete-file tmp-name))))) 1189 (ignore-errors (delete-file tmp-name)))))
1154 1190
1155(ert-deftest tramp-test29-utf8 () 1191(ert-deftest tramp-test29-utf8 ()