Patchwork [4,of,4,v4] tests: change a clone test to work cross platform

login
register
mail settings
Submitter timeless@mozdev.org
Date Feb. 15, 2016, 5:48 a.m.
Message ID <27da457e162db0a3e9b4.1455515308@waste.org>
Download mbox | patch
Permalink /patch/13193/
State Rejected
Delegated to: Yuya Nishihara
Headers show

Comments

timeless@mozdev.org - Feb. 15, 2016, 5:48 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1454911205 0
#      Mon Feb 08 06:00:05 2016 +0000
# Node ID 27da457e162db0a3e9b43ce63b269a447afc0f7e
# Parent  de492f4be4555250f293171c3ff52566d9e46892
tests: change a clone test to work cross platform

While it is not easy to make a file 000 on Windows, you can
emulate some of the behaviors by replacing an unreadable directory
with /dev/null.
Yuya Nishihara - Feb. 15, 2016, 2:26 p.m.
On Sun, 14 Feb 2016 23:48:28 -0600, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1454911205 0
> #      Mon Feb 08 06:00:05 2016 +0000
> # Node ID 27da457e162db0a3e9b43ce63b269a447afc0f7e
> # Parent  de492f4be4555250f293171c3ff52566d9e46892
> tests: change a clone test to work cross platform
> 
> While it is not easy to make a file 000 on Windows, you can
> emulate some of the behaviors by replacing an unreadable directory
> with /dev/null.
> 
> diff --git a/tests/test-clone.t b/tests/test-clone.t
> --- a/tests/test-clone.t
> +++ b/tests/test-clone.t
> @@ -582,19 +582,18 @@
>  #endif
>    $ rm -rf b # work around bug with http clone
>  
> +Inaccessible source
> +
> +  $ hg clone /dev/null b
> +  abort: repository /dev/null not found!
> +  [255]

/dev/null is translated to nul on MSYS, so the output differs.

Because the test explicitly states "inaccessible", and test-clone.t has more
tests for the other kind of IOError/OSError, I think this change has little
benefit.

Patch

diff --git a/tests/test-clone.t b/tests/test-clone.t
--- a/tests/test-clone.t
+++ b/tests/test-clone.t
@@ -582,19 +582,18 @@ 
 #endif
   $ rm -rf b # work around bug with http clone
 
+Inaccessible source
+
+  $ hg clone /dev/null b
+  abort: repository /dev/null not found!
+  [255]
 
 #if unix-permissions no-root
 
-Inaccessible source
+Inaccessible destination
 
   $ mkdir a
   $ chmod 000 a
-  $ hg clone a b
-  abort: repository a not found!
-  [255]
-
-Inaccessible destination
-
   $ hg init b
   $ cd b
   $ hg clone . ../a