Patchwork tests: conditionalize test-tools.t for Windows support

login
register
mail settings
Submitter Matt Harbison
Date Jan. 15, 2015, 3:56 a.m.
Message ID <611e6cadffa20fb53eb9.1421294202@Envy>
Download mbox | patch
Permalink /patch/7465/
State Accepted
Commit 049a9e3a078d7c988cb12ed456aad6ec2779ea69
Headers show

Comments

Matt Harbison - Jan. 15, 2015, 3:56 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1421293239 18000
#      Wed Jan 14 22:40:39 2015 -0500
# Node ID 611e6cadffa20fb53eb98c16fd381535f221a93c
# Parent  e663146adf168050784aca4cc885d489c8ca1910
tests: conditionalize test-tools.t for Windows support

I still get the following diff on Windows 7 with NTFS.  I'm not sure if it is
expected and we should wildcard the link count, or if something needs to be
fixed.

  @@ -58,7 +58,7 @@

     $ ln bar baz
     $ f bar -n baz -l --hexdump -t --sha1 --lines=9 -B 20
  -  bar: file, links=2, newer than baz, sha1=612ca68d0305c821750a
  +  bar: file, links=0, newer than baz, sha1=612ca68d0305c821750a\r (esc)
     0000: 31 0a 32 0a 33 0a 34 0a 35 0a 36 0a 37 0a 38 0a |1.2.3.4.5.6.7.8.|
     0010: 39 0a                                           |9.|
Matt Mackall - Jan. 15, 2015, 11:18 p.m.
On Wed, 2015-01-14 at 22:56 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1421293239 18000
> #      Wed Jan 14 22:40:39 2015 -0500
> # Node ID 611e6cadffa20fb53eb98c16fd381535f221a93c
> # Parent  e663146adf168050784aca4cc885d489c8ca1910
> tests: conditionalize test-tools.t for Windows support

Queued for default, thanks.

Patch

diff --git a/tests/test-tools.t b/tests/test-tools.t
--- a/tests/test-tools.t
+++ b/tests/test-tools.t
@@ -38,10 +38,13 @@ 
   $ f foo
   foo:
 
+#if symlink
   $ f foo --mode
   foo: mode=644
+#endif
 
   $ seq 10 > bar
+#if unix-permissions symlink
   $ chmod +x bar
   $ f bar --newer foo --mode --type --size --dump --links --bytes 7
   bar: file, size=21, mode=755, links=1, newer than foo
@@ -51,6 +54,7 @@ 
   3
   4
   <<< no trailing newline
+#endif
 
   $ ln bar baz
   $ f bar -n baz -l --hexdump -t --sha1 --lines=9 -B 20
@@ -58,6 +62,7 @@ 
   0000: 31 0a 32 0a 33 0a 34 0a 35 0a 36 0a 37 0a 38 0a |1.2.3.4.5.6.7.8.|
   0010: 39 0a                                           |9.|
 
+#if unix-permissions symlink
   $ ln -s yadda l
   $ f . --recurse -MStmsB4
   .: directory with 4 files, size=120, mode=755
@@ -65,6 +70,7 @@ 
   ./baz: file, size=21, mode=755, md5=3b03, sha1=612c
   ./foo: file, size=4, mode=644, md5=d3b0, sha1=f1d2
   ./l: link, size=5, mode=777, md5=2faa, sha1=af93
+#endif
 
   $ f --quiet bar -DL 3
   1
@@ -73,6 +79,8 @@ 
 
   $ cd ..
 
+Yadda is a symlink
+#if symlink
   $ f -qr dir -HB 17
   dir: directory with 4 files
   dir/bar:
@@ -85,3 +93,16 @@ 
   0000: 66 6f 6f 0a                                     |foo.|
   dir/l:
   0000: 79 61 64 64 61                                  |yadda|
+#else
+  $ f -qr dir -HB 17
+  dir: directory with 3 files
+  dir/bar: (glob)
+  0000: 31 0a 32 0a 33 0a 34 0a 35 0a 36 0a 37 0a 38 0a |1.2.3.4.5.6.7.8.|
+  0010: 39                                              |9|
+  dir/baz: (glob)
+  0000: 31 0a 32 0a 33 0a 34 0a 35 0a 36 0a 37 0a 38 0a |1.2.3.4.5.6.7.8.|
+  0010: 39                                              |9|
+  dir/foo: (glob)
+  0000: 66 6f 6f 0a                                     |foo.|
+#endif
+