[PATCH] test-paths.t: enable for Windows

Adrian Buehlmann adrian at cadifra.com
Sun Jun 3 03:54:16 CDT 2012


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1338713403 -7200
# Node ID 9229db651cc58cc586ae9c8789783644bb527805
# Parent  8a436cee51530cff1aabee8db710d8bf882ae2c4
test-paths.t: enable for Windows

If the no-msys exit at the beginning is removed, the test fails on Windows with
MSYS with:

  --- C:\Users\adi\hgrepos\hg-main\tests\test-paths.t
  +++ C:\Users\adi\hgrepos\hg-main\tests\test-paths.t.err
  @@ -24,7 +24,7 @@
     expand = $TESTTMP/a/foo/bar (glob)
     $ SOMETHING=/foo hg paths
     dupe = $TESTTMP/b (glob)
  -  expand = /foo/bar
  +  expand = c:/MinGW/msys/1.0/foo/bar
     $ hg paths -q
     dupe
     expand

I'm "MSYS-escaping" /foo by prepending it with an additional '/'.

This additional '/' will show up in the respective result, if the test is
run on Linux, so I'm using a regex to also accept //foo/bar in the output.

Perhaps a bit ridiculous, but it works.

diff --git a/tests/test-paths.t b/tests/test-paths.t
--- a/tests/test-paths.t
+++ b/tests/test-paths.t
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" no-msys || exit 80 # MSYS will translate /foo/bar as if it was a real file path
-
   $ hg init a
   $ hg clone a b
   updating to branch default
@@ -24,9 +22,9 @@
   $ SOMETHING=foo hg paths
   dupe = $TESTTMP/b (glob)
   expand = $TESTTMP/a/foo/bar (glob)
-  $ SOMETHING=/foo hg paths
+  $ SOMETHING=//foo hg paths
   dupe = $TESTTMP/b (glob)
-  expand = /foo/bar
+  expand = [/]?/foo/bar (re)
   $ hg paths -q
   dupe
   expand


More information about the Mercurial-devel mailing list