[PATCH V2] test-init: enable for Windows

Adrian Buehlmann adrian at cadifra.com
Mon Jun 11 07:17:43 CDT 2012


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1339414862 -7200
# Node ID e7e74acae1f6cc485751ba7efc2459a7d0bdbe0f
# Parent  f2719b38738074324c2d2d81be481f05c7e431cb
test-init: enable for Windows

On Windows, we can't create a directory with the name " ", as that is
not a valid name for a directory.

diff --git a/tests/test-init.t b/tests/test-init.t
--- a/tests/test-init.t
+++ b/tests/test-init.t
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" no-windows || exit 80
-
 This test tries to exercise the ssh functionality with a dummy script
 
   $ checknewrepo()
@@ -124,7 +122,7 @@
 
 check names for repositories (clashes with URL schemes, special chars)
 
-  $ for i in bundle file hg http https old-http ssh static-http " " "with space"; do
+  $ for i in bundle file hg http https old-http ssh static-http "with space"; do
   >   printf "hg init \"$i\"... "
   >   hg init "$i"
   >   test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed"
@@ -137,8 +135,13 @@
   hg init "old-http"... ok
   hg init "ssh"... ok
   hg init "static-http"... ok
-  hg init " "... ok
   hg init "with space"... ok
+#if no-windows
+/* " " is not a valid name for a directory on Windows */
+  $ hg init " "
+  $ test -d " " -a -d " /.hg" && echo "ok" || echo "failed"
+  ok
+#endif
 
 creating 'local/sub/repo'
 


More information about the Mercurial-devel mailing list