aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2014-04-19 16:14:26 +0200
committerMichael Albinus2014-04-19 16:14:26 +0200
commit5305137ad626f32c7792dc558eebecd99dfa1f33 (patch)
tree5568be4370d2bf86a53f286c6b0a471de627e480
parent2a2e6726d1f7031d89fd6740e5b167476267f778 (diff)
downloademacs-5305137ad626f32c7792dc558eebecd99dfa1f33.tar.gz
emacs-5305137ad626f32c7792dc558eebecd99dfa1f33.zip
* automated/tramp-tests.el (tramp--test-check-files): Extend test.
(tramp-test31-utf8): Let-bind also `file-name-coding-system'.
-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 @@
12014-04-19 Michael Albinus <michael.albinus@gmx.de>
2
3 * automated/tramp-tests.el (tramp--test-check-files): Extend test.
4 (tramp-test31-utf8): Let-bind also `file-name-coding-system'.
5
12014-04-18 Michael Albinus <michael.albinus@gmx.de> 62014-04-18 Michael Albinus <michael.albinus@gmx.de>
2 7
3 * automated/tramp-tests.el (tramp-copy-size-limit): Set to nil. 8 * 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'."
1418 1418
1419(defun tramp--test-check-files (&rest files) 1419(defun tramp--test-check-files (&rest files)
1420 "Runs a simple but comprehensive test over every file in FILES." 1420 "Runs a simple but comprehensive test over every file in FILES."
1421 (let ((tmp-name (tramp--test-make-temp-name))) 1421 (let ((tmp-name1 (tramp--test-make-temp-name))
1422 (tmp-name2 (tramp--test-make-temp-name 'local)))
1422 (unwind-protect 1423 (unwind-protect
1423 (progn 1424 (progn
1424 (make-directory tmp-name) 1425 (make-directory tmp-name1)
1426 (make-directory tmp-name2)
1425 (dolist (elt files) 1427 (dolist (elt files)
1426 (let ((file (expand-file-name elt tmp-name))) 1428 (let ((file1 (expand-file-name elt tmp-name1))
1427 (write-region elt nil file) 1429 (file2 (expand-file-name elt tmp-name2)))
1428 (should (file-exists-p file)) 1430 (write-region elt nil file1)
1431 (should (file-exists-p file1))
1429 ;; Check file contents. 1432 ;; Check file contents.
1430 (with-temp-buffer 1433 (with-temp-buffer
1431 (insert-file-contents file) 1434 (insert-file-contents file1)
1432 (should (string-equal (buffer-string) elt))))) 1435 (should (string-equal (buffer-string) elt)))
1436 ;; Copy file both directions.
1437 (copy-file file1 tmp-name2)
1438 (should (file-exists-p file2))
1439 (delete-file file1)
1440 (should-not (file-exists-p file1))
1441 (copy-file file2 tmp-name1)
1442 (should (file-exists-p file1))))
1433 ;; Check file names. 1443 ;; Check file names.
1434 (should (equal (directory-files 1444 (should (equal (directory-files
1435 tmp-name nil directory-files-no-dot-files-regexp) 1445 tmp-name1 nil directory-files-no-dot-files-regexp)
1436 (sort files 'string-lessp)))) 1446 (sort (copy-sequence files) 'string-lessp)))
1437 (ignore-errors (delete-directory tmp-name 'recursive))))) 1447 (should (equal (directory-files
1448 tmp-name2 nil directory-files-no-dot-files-regexp)
1449 (sort (copy-sequence files) 'string-lessp))))
1450 (ignore-errors (delete-directory tmp-name1 'recursive))
1451 (ignore-errors (delete-directory tmp-name2 'recursive)))))
1438 1452
1439;; This test is inspired by Bug#17238. 1453;; This test is inspired by Bug#17238.
1440(ert-deftest tramp-test30-special-characters () 1454(ert-deftest tramp-test30-special-characters ()
@@ -1463,11 +1477,12 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
1463 (skip-unless (tramp--test-enabled)) 1477 (skip-unless (tramp--test-enabled))
1464 1478
1465 (let ((coding-system-for-read 'utf-8) 1479 (let ((coding-system-for-read 'utf-8)
1466 (coding-system-for-write 'utf-8)) 1480 (coding-system-for-write 'utf-8)
1467 (tramp--test-check-files 1481 (file-name-coding-system 'utf-8))
1468 "أصبح بوسعك الآن تنزيل نسخة كاملة من موسوعة ويكيبيديا العربية لتصفحها بلا اتصال بالإنترنت" 1482 (tramp--test-check-files
1469 "银河系漫游指南系列" 1483 "أصبح بوسعك الآن تنزيل نسخة كاملة من موسوعة ويكيبيديا العربية لتصفحها بلا اتصال بالإنترنت"
1470 "Автостопом по гала́ктике"))) 1484 "银河系漫游指南系列"
1485 "Автостопом по гала́ктике")))
1471 1486
1472;; This test is inspired by Bug#16928. 1487;; This test is inspired by Bug#16928.
1473(ert-deftest tramp-test32-asynchronous-requests () 1488(ert-deftest tramp-test32-asynchronous-requests ()