summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2019-03-06 12:06:09 +0100
committerMichael Albinus <michael.albinus@gmx.de>2019-03-06 12:06:09 +0100
commitbe147d24198479bd569e71603c1d80f579311872 (patch)
tree73669a8f973c8ccb092a4be3f6da43890d581a14 /test
parenta3be45ddf43da73ce91731cfd4792abf14596637 (diff)
downloademacs-be147d24198479bd569e71603c1d80f579311872.tar.gz
Handle empty strings in Tramp's expand-file-name implementations
* lisp/net/tramp.el (tramp-handle-expand-file-name): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): * lisp/net/tramp-sh.el (tramp-sh-handle-expand-file-name): * lisp/net/tramp-smb.el (tramp-smb-handle-expand-file-name): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-expand-file-name): Handle empty NAME. * test/lisp/net/tramp-tests.el (tramp-test01-file-name-syntax) (tramp-test01-file-name-syntax-simplified) (tramp-test01-file-name-syntax-separate): Use neutral IPv4 address. (tramp-test05-expand-file-name): Check also "." and "".
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/tramp-tests.el26
1 files changed, 19 insertions, 7 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index f470385be9f..69d5ba8b7df 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -238,8 +238,8 @@ properly. BODY shall not contain a timeout."
(should (tramp-tramp-file-p "/method:user@[::1]:"))
;; Using an IPv4 mapped IPv6 address.
- (should (tramp-tramp-file-p "/method:[::ffff:192.168.0.1]:"))
- (should (tramp-tramp-file-p "/method:user@[::ffff:192.168.0.1]:"))
+ (should (tramp-tramp-file-p "/method:[::ffff:1.2.3.4]:"))
+ (should (tramp-tramp-file-p "/method:user@[::ffff:1.2.3.4]:"))
;; Local file name part.
(should (tramp-tramp-file-p "/method:::"))
@@ -268,7 +268,7 @@ properly. BODY shall not contain a timeout."
(should-not (tramp-tramp-file-p "/1.2.3.4:"))
(should-not (tramp-tramp-file-p "/[]:"))
(should-not (tramp-tramp-file-p "/[::1]:"))
- (should-not (tramp-tramp-file-p "/[::ffff:192.168.0.1]:"))
+ (should-not (tramp-tramp-file-p "/[::ffff:1.2.3.4]:"))
(should-not (tramp-tramp-file-p "/host:/:"))
(should-not (tramp-tramp-file-p "/host1|host2:"))
(should-not (tramp-tramp-file-p "/user1@host1|user2@host2:"))
@@ -318,8 +318,8 @@ properly. BODY shall not contain a timeout."
(should (tramp-tramp-file-p "/user@[::1]:"))
;; Using an IPv4 mapped IPv6 address.
- (should (tramp-tramp-file-p "/[::ffff:192.168.0.1]:"))
- (should (tramp-tramp-file-p "/user@[::ffff:192.168.0.1]:"))
+ (should (tramp-tramp-file-p "/[::ffff:1.2.3.4]:"))
+ (should (tramp-tramp-file-p "/user@[::ffff:1.2.3.4]:"))
;; Local file name part.
(should (tramp-tramp-file-p "/host::"))
@@ -372,8 +372,8 @@ properly. BODY shall not contain a timeout."
(should (tramp-tramp-file-p "/[method/user@::1]"))
;; Using an IPv4 mapped IPv6 address.
- (should (tramp-tramp-file-p "/[method/::ffff:192.168.0.1]"))
- (should (tramp-tramp-file-p "/[method/user@::ffff:192.168.0.1]"))
+ (should (tramp-tramp-file-p "/[method/::ffff:1.2.3.4]"))
+ (should (tramp-tramp-file-p "/[method/user@::ffff:1.2.3.4]"))
;; Local file name part.
(should (tramp-tramp-file-p "/[method/]"))
@@ -1988,6 +1988,18 @@ properly. BODY shall not contain a timeout."
(should
(string-equal
(expand-file-name "/method:host:/path/../file") "/method:host:/file"))
+ (should
+ (string-equal
+ (expand-file-name "/method:host:/path/.") "/method:host:/path"))
+ (should
+ (string-equal
+ (expand-file-name "/method:host:/path/..") "/method:host:/"))
+ (should
+ (string-equal
+ (expand-file-name "." "/method:host:/path/") "/method:host:/path"))
+ (should
+ (string-equal
+ (expand-file-name "" "/method:host:/path/") "/method:host:/path"))
;; Quoting local part.
(should
(string-equal