summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2014-04-19 16:14:26 +0200
committerMichael Albinus <michael.albinus@gmx.de>2014-04-19 16:14:26 +0200
commit5305137ad626f32c7792dc558eebecd99dfa1f33 (patch)
tree5568be4370d2bf86a53f286c6b0a471de627e480 /test
parent2a2e6726d1f7031d89fd6740e5b167476267f778 (diff)
downloademacs-5305137ad626f32c7792dc558eebecd99dfa1f33.tar.gz
* automated/tramp-tests.el (tramp--test-check-files): Extend test.
(tramp-test31-utf8): Let-bind also `file-name-coding-system'.
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog5
-rw-r--r--test/automated/tramp-tests.el45
2 files changed, 35 insertions, 15 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 0d8dd76ff91..d677d13db44 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2014-04-19 Michael Albinus <michael.albinus@gmx.de>
+
+ * automated/tramp-tests.el (tramp--test-check-files): Extend test.
+ (tramp-test31-utf8): Let-bind also `file-name-coding-system'.
+
2014-04-18 Michael Albinus <michael.albinus@gmx.de>
* automated/tramp-tests.el (tramp-copy-size-limit): Set to nil.
diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el
index dff9103c4a7..607718412fd 100644
--- a/test/automated/tramp-tests.el
+++ b/test/automated/tramp-tests.el
@@ -1418,23 +1418,37 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(defun tramp--test-check-files (&rest files)
"Runs a simple but comprehensive test over every file in FILES."
- (let ((tmp-name (tramp--test-make-temp-name)))
+ (let ((tmp-name1 (tramp--test-make-temp-name))
+ (tmp-name2 (tramp--test-make-temp-name 'local)))
(unwind-protect
(progn
- (make-directory tmp-name)
+ (make-directory tmp-name1)
+ (make-directory tmp-name2)
(dolist (elt files)
- (let ((file (expand-file-name elt tmp-name)))
- (write-region elt nil file)
- (should (file-exists-p file))
+ (let ((file1 (expand-file-name elt tmp-name1))
+ (file2 (expand-file-name elt tmp-name2)))
+ (write-region elt nil file1)
+ (should (file-exists-p file1))
;; Check file contents.
(with-temp-buffer
- (insert-file-contents file)
- (should (string-equal (buffer-string) elt)))))
+ (insert-file-contents file1)
+ (should (string-equal (buffer-string) elt)))
+ ;; Copy file both directions.
+ (copy-file file1 tmp-name2)
+ (should (file-exists-p file2))
+ (delete-file file1)
+ (should-not (file-exists-p file1))
+ (copy-file file2 tmp-name1)
+ (should (file-exists-p file1))))
;; Check file names.
(should (equal (directory-files
- tmp-name nil directory-files-no-dot-files-regexp)
- (sort files 'string-lessp))))
- (ignore-errors (delete-directory tmp-name 'recursive)))))
+ tmp-name1 nil directory-files-no-dot-files-regexp)
+ (sort (copy-sequence files) 'string-lessp)))
+ (should (equal (directory-files
+ tmp-name2 nil directory-files-no-dot-files-regexp)
+ (sort (copy-sequence files) 'string-lessp))))
+ (ignore-errors (delete-directory tmp-name1 'recursive))
+ (ignore-errors (delete-directory tmp-name2 'recursive)))))
;; This test is inspired by Bug#17238.
(ert-deftest tramp-test30-special-characters ()
@@ -1463,11 +1477,12 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(skip-unless (tramp--test-enabled))
(let ((coding-system-for-read 'utf-8)
- (coding-system-for-write 'utf-8))
- (tramp--test-check-files
- "أصبح بوسعك الآن تنزيل نسخة كاملة من موسوعة ويكيبيديا العربية لتصفحها بلا اتصال بالإنترنت"
- "银河系漫游指南系列"
- "Автостопом по гала́ктике")))
+ (coding-system-for-write 'utf-8)
+ (file-name-coding-system 'utf-8))
+ (tramp--test-check-files
+ "أصبح بوسعك الآن تنزيل نسخة كاملة من موسوعة ويكيبيديا العربية لتصفحها بلا اتصال بالإنترنت"
+ "银河系漫游指南系列"
+ "Автостопом по гала́ктике")))
;; This test is inspired by Bug#16928.
(ert-deftest tramp-test32-asynchronous-requests ()