diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index dfb01126f70..5e79a4bce6f 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -1722,6 +1722,28 @@ handled properly. BODY shall not contain a timeout." | |||
| 1722 | ;; Default values in tramp-smb.el. | 1722 | ;; Default values in tramp-smb.el. |
| 1723 | (should (string-equal (file-remote-p "/smb::" 'user) nil))) | 1723 | (should (string-equal (file-remote-p "/smb::" 'user) nil))) |
| 1724 | 1724 | ||
| 1725 | ;; The following test is inspired by Bug#30946. | ||
| 1726 | (ert-deftest tramp-test03-file-name-host-rules () | ||
| 1727 | "Check host name rules for host-less methods." | ||
| 1728 | (skip-unless (tramp--test-enabled)) | ||
| 1729 | (skip-unless (tramp--test-sh-p)) | ||
| 1730 | |||
| 1731 | ;; Host names must match rules in case the command template of a | ||
| 1732 | ;; method doesn't use them. | ||
| 1733 | (dolist (m '("su" "sg" "sudo" "doas" "ksu")) | ||
| 1734 | ;; Single hop. The host name must match `tramp-local-host-regexp'. | ||
| 1735 | (should-error | ||
| 1736 | (find-file (format "/%s:foo:" m)) | ||
| 1737 | :type 'user-error) | ||
| 1738 | ;; Multi hop. The host name must match the previous hop. | ||
| 1739 | (should-error | ||
| 1740 | (find-file | ||
| 1741 | (format | ||
| 1742 | "%s|%s:foo:" | ||
| 1743 | (substring (file-remote-p tramp-test-temporary-file-directory) nil -1) | ||
| 1744 | m)) | ||
| 1745 | :type 'user-error))) | ||
| 1746 | |||
| 1725 | (ert-deftest tramp-test04-substitute-in-file-name () | 1747 | (ert-deftest tramp-test04-substitute-in-file-name () |
| 1726 | "Check `substitute-in-file-name'." | 1748 | "Check `substitute-in-file-name'." |
| 1727 | (should (string-equal (substitute-in-file-name "/method:host:///foo") "/foo")) | 1749 | (should (string-equal (substitute-in-file-name "/method:host:///foo") "/foo")) |
| @@ -1836,6 +1858,7 @@ handled properly. BODY shall not contain a timeout." | |||
| 1836 | ;; Mark as failed until bug has been fixed. | 1858 | ;; Mark as failed until bug has been fixed. |
| 1837 | :expected-result :failed | 1859 | :expected-result :failed |
| 1838 | (skip-unless (tramp--test-enabled)) | 1860 | (skip-unless (tramp--test-enabled)) |
| 1861 | |||
| 1839 | ;; These are the methods the test doesn't fail. | 1862 | ;; These are the methods the test doesn't fail. |
| 1840 | (when (or (tramp--test-adb-p) (tramp--test-gvfs-p) | 1863 | (when (or (tramp--test-adb-p) (tramp--test-gvfs-p) |
| 1841 | (tramp-smb-file-name-p tramp-test-temporary-file-directory)) | 1864 | (tramp-smb-file-name-p tramp-test-temporary-file-directory)) |