[PATCH V2] test-init: enable for Windows

Adrian Buehlmann adrian at cadifra.com
Tue Jun 12 02:00:09 CDT 2012


On 2012-06-12 03:24, Mads Kiilerich wrote:
> Adrian Buehlmann wrote, On 06/11/2012 02:17 PM:
>> # 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.
> 
> Pushed to crew, thanks
> 
>> +  $ test -d " " -a -d " /.hg" && echo "ok" || echo "failed"
> 
> check-code said hi - fixed.

Yep. Missed that one (check-code always hits when you wouldn't expect it).

+  tests/test-init.t:142:
+   >   $ test -d " " -a -d " /.hg" && echo "ok" || echo "failed"
+   explicit exit code checks unnecessary
+  FAILURE IS NOT AN OPTION!!!

Thanks for fixing it with:

#if no-windows
/* " " is not a valid name for a directory on Windows */
  $ hg init " "
  $ test -d " "
  $ test -d " /.hg"
#endif

The check-code complaint was a copy from

  $ 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"
  > done

which is still in the file, lurking for the next one who copies it.

Soo... Perhaps we also want (in order not to give bad examples):

# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1339483993 -7200
# Node ID 7aa487d87cdd9aeaf699d02e012b77299dc0df6d
# Parent  b112e265b78a614dac15d5be92d39926d5e653da
test-init.t: remove unneeded explicit exit code checking

check-code said somewhere else:

+   >   $ test -d " " -a -d " /.hg" && echo "ok" || echo "failed"
+   explicit exit code checks unnecessary
+  FAILURE IS NOT AN OPTION!!!

diff --git a/tests/test-init.t b/tests/test-init.t
--- a/tests/test-init.t
+++ b/tests/test-init.t
@@ -123,19 +123,10 @@
 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
-  >   printf "hg init \"$i\"... "
   >   hg init "$i"
-  >   test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed"
+  >   test -d "$i"
+  >   test -d "$i/.hg"
   > done
-  hg init "bundle"... ok
-  hg init "file"... ok
-  hg init "hg"... ok
-  hg init "http"... ok
-  hg init "https"... ok
-  hg init "old-http"... ok
-  hg init "ssh"... ok
-  hg init "static-http"... ok
-  hg init "with space"... ok
 #if no-windows
 /* " " is not a valid name for a directory on Windows */
   $ hg init " "


More information about the Mercurial-devel mailing list