unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#32304: 27.0.50; tramp-tests issue with double slash
@ 2018-07-29 15:54 Ken Brown
  2018-07-29 16:27 ` Michael Albinus
  0 siblings, 1 reply; 27+ messages in thread
From: Ken Brown @ 2018-07-29 15:54 UTC (permalink / raw)
  To: 32304

[-- Attachment #1: Type: text/plain, Size: 1253 bytes --]

The following parts of tramp-test04-substitute-in-file-name are failing
on Cygwin (and probably also on MS-Windows, but I can't easily test
that):

(should
    (string-equal
     (substitute-in-file-name "/method:host://foo") "/method:host:/foo"))
(should
    (string-equal (substitute-in-file-name "/method:host:/path///foo") 
"/foo"))
(should
    (string-equal (substitute-in-file-name "/method:host://~foo") "/~foo"))

Here are the corresponding evaluations:

(substitute-in-file-name "/method:host://foo")
"/method:host://foo"

(substitute-in-file-name "/method:host:/path///foo")
"//foo"

(substitute-in-file-name "/method:host://~foo")
"//~foo"

This is a consequence of the fact that Tramp calls
substitute-in-file-name on the local part of the file name:

(substitute-in-file-name "//foo")
"//foo"

(substitute-in-file-name "/path///foo")
"//foo"

(substitute-in-file-name "//~foo")
"//~foo"

"//" has a special meaning at the beginning of a file name on Cygwin and
MS-Windows; see the comment near the beginning of
search_embedded_absfilename.  So I don't think there's a real bug here.
Maybe the expected result of the test should simply be adjusted, as in
the attached patch.  Someone who builds on MS-Windows would have to
check this.

Ken


[-- Attachment #2: 0001-Adjust-expected-results-on-a-tramp-test.patch --]
[-- Type: text/plain, Size: 1961 bytes --]

From 328766e02145fcfcdd54c124ff866ce8f2e15d59 Mon Sep 17 00:00:00 2001
From: Ken Brown <kbrown@cornell.edu>
Date: Sun, 29 Jul 2018 11:45:26 -0400
Subject: [PATCH] Adjust expected results on a tramp test

* test/lisp/net/tramp-tests.el
(tramp-test04-substitute-in-file-name): Adjust the expected
results on Cygwin and MS-Windows, where "//" at the beginning
of a file name has a special meaning.  (Bug#99999)
---
 test/lisp/net/tramp-tests.el | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 5c5eff8798..a29df1682c 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -1781,9 +1781,15 @@ tramp--test-print-duration
   (should (string-equal (substitute-in-file-name "/method:host:///foo") "/foo"))
   (should
    (string-equal
-    (substitute-in-file-name "/method:host://foo") "/method:host:/foo"))
+    (substitute-in-file-name "/method:host://foo")
+    (if (memq system-type '(cygwin windows-nt))
+        "/method:host://foo"
+      "/method:host:/foo")))
   (should
-   (string-equal (substitute-in-file-name "/method:host:/path///foo") "/foo"))
+   (string-equal (substitute-in-file-name "/method:host:/path///foo")
+                 (if (memq system-type '(cygwin windows-nt))
+                     "//foo"
+                   "/foo")))
   (should
    (string-equal
     (substitute-in-file-name "/method:host:/path//foo") "/method:host:/foo"))
@@ -1804,7 +1810,10 @@ tramp--test-print-duration
     "/method:host:/:/path//foo"))
 
   (should
-   (string-equal (substitute-in-file-name "/method:host://~foo") "/~foo"))
+   (string-equal (substitute-in-file-name "/method:host://~foo")
+                 (if (memq system-type '(cygwin windows-nt))
+                     "//~foo"
+                   "/~foo")))
   (should
    (string-equal
     (substitute-in-file-name "/method:host:/~foo") "/method:host:/~foo"))
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2018-08-10  7:27 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-29 15:54 bug#32304: 27.0.50; tramp-tests issue with double slash Ken Brown
2018-07-29 16:27 ` Michael Albinus
2018-07-29 16:47   ` Ken Brown
2018-07-29 16:55     ` Michael Albinus
2018-07-29 17:00       ` Ken Brown
2018-07-30 10:43     ` Michael Albinus
2018-07-30 12:17       ` Ken Brown
2018-07-30 14:45         ` Eli Zaretskii
2018-07-30 20:50           ` Michael Albinus
2018-07-31  2:34             ` Eli Zaretskii
2018-07-31  5:00               ` Michael Albinus
2018-08-08 13:48               ` Michael Albinus
2018-08-08 14:35                 ` Eli Zaretskii
2018-08-08 14:42                   ` Eli Zaretskii
2018-08-08 18:06                     ` Michael Albinus
2018-08-09 12:24                       ` Michael Albinus
2018-08-09 15:18                         ` Eli Zaretskii
2018-08-10  7:27                           ` Michael Albinus
2018-08-08 15:26                   ` Michael Albinus
2018-08-08 15:57                     ` Eli Zaretskii
2018-07-31  4:58         ` Michael Albinus
2018-07-29 17:26   ` Eli Zaretskii
2018-07-30  8:26     ` Michael Albinus
2018-07-31 14:46   ` Andy Moreton
2018-07-31 20:57     ` Michael Albinus
2018-07-31 22:07       ` Ken Brown
2018-08-01 20:51         ` Michael Albinus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).