aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2017-05-16 14:49:51 +0200
committerMichael Albinus2017-05-16 14:49:51 +0200
commit712a5faa2c95596db2d4d94dada575ad16b317c5 (patch)
tree1dc9fe18ee8aada344c6f2e6317ececf2567fa0e /test
parent014f1cc06438f75c3fe267ae92e706855bba675d (diff)
downloademacs-712a5faa2c95596db2d4d94dada575ad16b317c5.tar.gz
emacs-712a5faa2c95596db2d4d94dada575ad16b317c5.zip
Extend tramp-tests.el
* test/lisp/net/tramp-tests.el (tramp-change-syntax): Remove declaration, not needed anymore. (tramp-test05-expand-file-name-relative): New test. (tramp-test10-write-region): Extend test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/tramp-tests.el31
1 files changed, 29 insertions, 2 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index d3a93d27b29..bcf2e840fd7 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -45,7 +45,6 @@
45(require 'vc-git) 45(require 'vc-git)
46(require 'vc-hg) 46(require 'vc-hg)
47 47
48(declare-function tramp-change-syntax "tramp-cmds")
49(declare-function tramp-find-executable "tramp-sh") 48(declare-function tramp-find-executable "tramp-sh")
50(declare-function tramp-get-remote-path "tramp-sh") 49(declare-function tramp-get-remote-path "tramp-sh")
51(declare-function tramp-get-remote-stat "tramp-sh") 50(declare-function tramp-get-remote-stat "tramp-sh")
@@ -1616,6 +1615,21 @@ handled properly. BODY shall not contain a timeout."
1616 (expand-file-name "/method:host:/:/~/path/./file") 1615 (expand-file-name "/method:host:/:/~/path/./file")
1617 "/method:host:/:/~/path/file"))) 1616 "/method:host:/:/~/path/file")))
1618 1617
1618;; The following test is inspired by Bug#26911. It is rather a bug in
1619;; `expand-file-name', and it fails for all Emacs versions. Test
1620;; added for later, when it is fixed.
1621(ert-deftest tramp-test05-expand-file-name-relative ()
1622 "Check `expand-file-name'."
1623 ;; Mark as failed until bug has been fixed.
1624 :expected-result :failed
1625 (should
1626 (string-equal
1627 (let ((default-directory
1628 (concat
1629 (file-remote-p tramp-test-temporary-file-directory) "/path")))
1630 (expand-file-name ".." "./"))
1631 (concat (file-remote-p tramp-test-temporary-file-directory) "/"))))
1632
1619(ert-deftest tramp-test06-directory-file-name () 1633(ert-deftest tramp-test06-directory-file-name ()
1620 "Check `directory-file-name'. 1634 "Check `directory-file-name'.
1621This checks also `file-name-as-directory', `file-name-directory', 1635This checks also `file-name-as-directory', `file-name-directory',
@@ -1745,13 +1759,25 @@ This checks also `file-name-as-directory', `file-name-directory',
1745 (let ((tmp-name (tramp--test-make-temp-name nil quoted))) 1759 (let ((tmp-name (tramp--test-make-temp-name nil quoted)))
1746 (unwind-protect 1760 (unwind-protect
1747 (progn 1761 (progn
1748 ;; Write buffer. 1762 ;; Write buffer. Use absolute and relative file name.
1749 (with-temp-buffer 1763 (with-temp-buffer
1750 (insert "foo") 1764 (insert "foo")
1751 (write-region nil nil tmp-name)) 1765 (write-region nil nil tmp-name))
1752 (with-temp-buffer 1766 (with-temp-buffer
1753 (insert-file-contents tmp-name) 1767 (insert-file-contents tmp-name)
1754 (should (string-equal (buffer-string) "foo"))) 1768 (should (string-equal (buffer-string) "foo")))
1769 (delete-file tmp-name)
1770 (with-temp-buffer
1771 (insert "foo")
1772 (should-not (file-exists-p tmp-name))
1773 (let ((default-directory (file-name-directory tmp-name)))
1774 (should-not (file-exists-p (file-name-nondirectory tmp-name)))
1775 (write-region nil nil (file-name-nondirectory tmp-name))
1776 (should (file-exists-p (file-name-nondirectory tmp-name))))
1777 (should (file-exists-p tmp-name)))
1778 (with-temp-buffer
1779 (insert-file-contents tmp-name)
1780 (should (string-equal (buffer-string) "foo")))
1755 1781
1756 ;; Append. 1782 ;; Append.
1757 (with-temp-buffer 1783 (with-temp-buffer
@@ -3721,6 +3747,7 @@ Since it unloads Tramp, it shall be the last test to run."
3721;; * set-file-selinux-context 3747;; * set-file-selinux-context
3722 3748
3723;; * Work on skipped tests. Make a comment, when it is impossible. 3749;; * Work on skipped tests. Make a comment, when it is impossible.
3750;; * Fix `tramp-test05-expand-file-name-relative' in `expand-file-name'.
3724;; * Fix `tramp-test06-directory-file-name' for `ftp'. 3751;; * Fix `tramp-test06-directory-file-name' for `ftp'.
3725;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?). 3752;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?).
3726;; * Fix Bug#16928. Set expected error of `tramp-test36-asynchronous-requests'. 3753;; * Fix Bug#16928. Set expected error of `tramp-test36-asynchronous-requests'.