aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2018-02-05 14:02:49 +0100
committerMichael Albinus2018-02-05 14:02:49 +0100
commitc24c5dc4a4cc18e7f1ec949efcfe1d4bae541d02 (patch)
tree094f175c3e001aab5ec37a18a7db0ae3175bf6a9 /test
parent8fbf28536ee1169f59206523e2af050916befbf6 (diff)
downloademacs-c24c5dc4a4cc18e7f1ec949efcfe1d4bae541d02.tar.gz
emacs-c24c5dc4a4cc18e7f1ec949efcfe1d4bae541d02.zip
Fix inconsistency expanding "//" in Tramp
* doc/misc/tramp.texi (File name completion): Adapt example expanding "//". * lisp/net/tramp.el (tramp-handle-substitute-in-file-name): "//" shall expand the localname only, even when on top of the local part. * test/lisp/net/tramp-tests.el (tramp-test04-substitute-in-file-name): Adapt test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/tramp-tests.el42
1 files changed, 31 insertions, 11 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 7a12d1468bf..422e71df7c3 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -1712,39 +1712,59 @@ handled properly. BODY shall not contain a timeout."
1712 1712
1713(ert-deftest tramp-test04-substitute-in-file-name () 1713(ert-deftest tramp-test04-substitute-in-file-name ()
1714 "Check `substitute-in-file-name'." 1714 "Check `substitute-in-file-name'."
1715 (should (string-equal (substitute-in-file-name "/method:host://foo") "/foo")) 1715 (should (string-equal (substitute-in-file-name "/method:host:///foo") "/foo"))
1716 (should 1716 (should
1717 (string-equal 1717 (string-equal
1718 (substitute-in-file-name "/method:host:/path//foo") "/method:host:/foo")) 1718 (substitute-in-file-name "/method:host://foo") "/method:host:/foo"))
1719 (should 1719 (should
1720 (string-equal (substitute-in-file-name "/method:host:/path///foo") "/foo")) 1720 (string-equal (substitute-in-file-name "/method:host:/path///foo") "/foo"))
1721 (should
1722 (string-equal
1723 (substitute-in-file-name "/method:host:/path//foo") "/method:host:/foo"))
1721 ;; Quoting local part. 1724 ;; Quoting local part.
1722 (should 1725 (should
1723 (string-equal 1726 (string-equal
1724 (substitute-in-file-name "/method:host:/://foo") "/method:host:/://foo")) 1727 (substitute-in-file-name "/method:host:/:///foo") "/method:host:/:///foo"))
1725 (should 1728 (should
1726 (string-equal 1729 (string-equal
1727 (substitute-in-file-name "/method:host:/:/path//foo") 1730 (substitute-in-file-name "/method:host:/://foo") "/method:host:/://foo"))
1728 "/method:host:/:/path//foo"))
1729 (should 1731 (should
1730 (string-equal 1732 (string-equal
1731 (substitute-in-file-name "/method:host:/:/path///foo") 1733 (substitute-in-file-name "/method:host:/:/path///foo")
1732 "/method:host:/:/path///foo")) 1734 "/method:host:/:/path///foo"))
1735 (should
1736 (string-equal
1737 (substitute-in-file-name "/method:host:/:/path//foo")
1738 "/method:host:/:/path//foo"))
1733 1739
1734 (should 1740 (should
1741 (string-equal (substitute-in-file-name "/method:host://~foo") "/~foo"))
1742 (should
1735 (string-equal 1743 (string-equal
1736 (substitute-in-file-name "/method:host:/path/~/foo") "/method:host:~/foo")) 1744 (substitute-in-file-name "/method:host:/~foo") "/method:host:/~foo"))
1737 (should 1745 (should
1738 (string-equal (substitute-in-file-name "/method:host:/path//~/foo") "~/foo")) 1746 (string-equal (substitute-in-file-name "/method:host:/path//~foo") "/~foo"))
1747 ;; (substitute-in-file-name "/path/~foo") expands only to "/~foo"",
1748 ;; if $LOGNAME or $USER is "foo". Otherwise, it doesn't expand.
1749 (should
1750 (string-equal
1751 (substitute-in-file-name
1752 "/method:host:/path/~foo") "/method:host:/path/~foo"))
1739 ;; Quoting local part. 1753 ;; Quoting local part.
1740 (should 1754 (should
1741 (string-equal 1755 (string-equal
1742 (substitute-in-file-name "/method:host:/:/path/~/foo") 1756 (substitute-in-file-name "/method:host:/://~foo") "/method:host:/://~foo"))
1743 "/method:host:/:/path/~/foo")) 1757 (should
1758 (string-equal
1759 (substitute-in-file-name "/method:host:/:/~foo") "/method:host:/:/~foo"))
1760 (should
1761 (string-equal
1762 (substitute-in-file-name
1763 "/method:host:/:/path//~foo") "/method:host:/:/path//~foo"))
1744 (should 1764 (should
1745 (string-equal 1765 (string-equal
1746 (substitute-in-file-name "/method:host:/:/path//~/foo") 1766 (substitute-in-file-name
1747 "/method:host:/:/path//~/foo")) 1767 "/method:host:/:/path/~foo") "/method:host:/:/path/~foo"))
1748 1768
1749 (let (process-environment) 1769 (let (process-environment)
1750 (should 1770 (should