diff options
| author | Michael Albinus | 2014-02-11 09:31:39 +0100 |
|---|---|---|
| committer | Michael Albinus | 2014-02-11 09:31:39 +0100 |
| commit | 581d24e701655c70bf318f00d270fb6f3aad2cc7 (patch) | |
| tree | d68c06be98717a3a5a39fada7112c9b531f48ad9 | |
| parent | b8b4e743b77068d2b17a15daa2b0af325f9f9825 (diff) | |
| download | emacs-581d24e701655c70bf318f00d270fb6f3aad2cc7.tar.gz emacs-581d24e701655c70bf318f00d270fb6f3aad2cc7.zip | |
* automated/tramp-tests.el (top): Require `vc', `vc-bzr', `vc-git'
and `vc-hg'. Declare `tramp-find-executable' and
`tramp-get-remote-path'.
(tramp-test29-vc-registered): New test.
(tramp-test30-utf8): Rename from `tramp-test29-utf8'.
| -rw-r--r-- | test/ChangeLog | 8 | ||||
| -rw-r--r-- | test/automated/tramp-tests.el | 58 |
2 files changed, 64 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index e3902c02477..370545d4368 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2014-02-11 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * automated/tramp-tests.el (top): Require `vc', `vc-bzr', `vc-git' | ||
| 4 | and `vc-hg'. Declare `tramp-find-executable' and | ||
| 5 | `tramp-get-remote-path'. | ||
| 6 | (tramp-test29-vc-registered): New test. | ||
| 7 | (tramp-test30-utf8): Rename from `tramp-test29-utf8'. | ||
| 8 | |||
| 1 | 2014-02-07 Michael Albinus <michael.albinus@gmx.de> | 9 | 2014-02-07 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 10 | ||
| 3 | * automated/tramp-tests.el (tramp-test26-process-file): Improve test. | 11 | * automated/tramp-tests.el (tramp-test26-process-file): Improve test. |
diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el index 67f55254da1..46540317e37 100644 --- a/test/automated/tramp-tests.el +++ b/test/automated/tramp-tests.el | |||
| @@ -37,6 +37,13 @@ | |||
| 37 | 37 | ||
| 38 | (require 'ert) | 38 | (require 'ert) |
| 39 | (require 'tramp) | 39 | (require 'tramp) |
| 40 | (require 'vc) | ||
| 41 | (require 'vc-bzr) | ||
| 42 | (require 'vc-git) | ||
| 43 | (require 'vc-hg) | ||
| 44 | |||
| 45 | (declare-function tramp-find-executable "tramp-sh") | ||
| 46 | (declare-function tramp-get-remote-path "tramp-sh") | ||
| 40 | 47 | ||
| 41 | ;; There is no default value on w32 systems, which could work out of the box. | 48 | ;; There is no default value on w32 systems, which could work out of the box. |
| 42 | (defconst tramp-test-temporary-file-directory | 49 | (defconst tramp-test-temporary-file-directory |
| @@ -1188,7 +1195,55 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 1188 | (format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string)))) | 1195 | (format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string)))) |
| 1189 | (ignore-errors (delete-file tmp-name))))) | 1196 | (ignore-errors (delete-file tmp-name))))) |
| 1190 | 1197 | ||
| 1191 | (ert-deftest tramp-test29-utf8 () | 1198 | (ert-deftest tramp-test29-vc-registered () |
| 1199 | "Check `vc-registered'." | ||
| 1200 | (skip-unless (tramp--test-enabled)) | ||
| 1201 | (skip-unless | ||
| 1202 | (eq | ||
| 1203 | (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) | ||
| 1204 | 'tramp-sh-file-name-handler)) | ||
| 1205 | (tramp-cleanup-connection | ||
| 1206 | (tramp-dissect-file-name tramp-test-temporary-file-directory) | ||
| 1207 | nil 'keep-password) | ||
| 1208 | |||
| 1209 | (let* ((default-directory tramp-test-temporary-file-directory) | ||
| 1210 | (tmp-name1 (tramp--test-make-temp-name)) | ||
| 1211 | (tmp-name2 (expand-file-name "foo" tmp-name1)) | ||
| 1212 | (vc-handled-backends | ||
| 1213 | (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil | ||
| 1214 | (cond | ||
| 1215 | ((tramp-find-executable v vc-bzr-program (tramp-get-remote-path v)) | ||
| 1216 | '(Bzr)) | ||
| 1217 | ((tramp-find-executable v vc-git-program (tramp-get-remote-path v)) | ||
| 1218 | '(Git)) | ||
| 1219 | ((tramp-find-executable v vc-hg-program (tramp-get-remote-path v)) | ||
| 1220 | '(Hg)) | ||
| 1221 | (t nil))))) | ||
| 1222 | (skip-unless vc-handled-backends) | ||
| 1223 | (message "%s" vc-handled-backends) | ||
| 1224 | |||
| 1225 | (unwind-protect | ||
| 1226 | (progn | ||
| 1227 | (make-directory tmp-name1) | ||
| 1228 | (write-region "foo" nil tmp-name2) | ||
| 1229 | (should (file-directory-p tmp-name1)) | ||
| 1230 | (should (file-exists-p tmp-name2)) | ||
| 1231 | (should-not (vc-registered tmp-name1)) | ||
| 1232 | (should-not (vc-registered tmp-name2)) | ||
| 1233 | |||
| 1234 | (let ((default-directory tmp-name1)) | ||
| 1235 | ;; Create empty repository, and register the file. | ||
| 1236 | (vc-create-repo (car vc-handled-backends)) | ||
| 1237 | ;; The structure of VC-FILESET is not documented. Let's | ||
| 1238 | ;; hope it won't change. | ||
| 1239 | (vc-register | ||
| 1240 | nil (list (car vc-handled-backends) | ||
| 1241 | (list (file-name-nondirectory tmp-name2))))) | ||
| 1242 | (should (vc-registered tmp-name2))) | ||
| 1243 | |||
| 1244 | (ignore-errors (delete-directory tmp-name1 'recursive))))) | ||
| 1245 | |||
| 1246 | (ert-deftest tramp-test30-utf8 () | ||
| 1192 | "Check UTF8 encoding in file names and file contents." | 1247 | "Check UTF8 encoding in file names and file contents." |
| 1193 | (skip-unless (tramp--test-enabled)) | 1248 | (skip-unless (tramp--test-enabled)) |
| 1194 | (tramp-cleanup-connection | 1249 | (tramp-cleanup-connection |
| @@ -1227,7 +1282,6 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 1227 | ;; * make-auto-save-file-name | 1282 | ;; * make-auto-save-file-name |
| 1228 | ;; * set-file-acl | 1283 | ;; * set-file-acl |
| 1229 | ;; * set-file-selinux-context | 1284 | ;; * set-file-selinux-context |
| 1230 | ;; * vc-registered | ||
| 1231 | 1285 | ||
| 1232 | ;; * Fix `tramp-test17-insert-directory' for | 1286 | ;; * Fix `tramp-test17-insert-directory' for |
| 1233 | ;; `ls-lisp-insert-directory' ("plink" and friends). | 1287 | ;; `ls-lisp-insert-directory' ("plink" and friends). |