Subject: [PATCH 14/13] wildmatch: fix tests that fail on Windows due to path mangling

From: Johannes Sixt <[email-masked]>
Date: Sun, 04 Nov 2012 22:00:31 +0100

Patterns beginning with a slash are converted to Windows paths before
test-wildmatch gets to see them. Use a different first character. This
does change the meaning of the test because the slash is special. But:

- The first pair of changed lines the test is about '*' matching an empty
  string, which does not need the slash.

- The second pair of changed lines the test is about a sequence of '*/',
  and I think we can afford to test without the leading slash.

One case is unchanged:

    match 1 x '/foo' '**/foo'

Even though the test is about ** matching zero levels at the beginning of
a path, on Windows, '**' actually matches something because /foo is
converted to c:\path\to\msys\foo. Let's be lazy and let this pass.

Signed-off-by: Johannes Sixt <[email-masked]>
---
 After this change, there are still 3 failing tests that are in connection
 with [[:xdigit:]]. Don't know, yet, what's going on there.

 t/t3070-wildmatch.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/t3070-wildmatch.sh b/t/t3070-wildmatch.sh
index e6ad6f4..74c0f7c 100755
--- a/t/t3070-wildmatch.sh
+++ b/t/t3070-wildmatch.sh
@@ -95,8 +95,8 @@ match 0 0 ']' '[!]-]'
 match 1 x 'a' '[!]-]'
 match 0 0 '' '\'
 match 0 x '\' '\'
-match 0 x '/\' '*/\'
-match 1 x '/\' '*/\\'
+match 0 x '-\' '*-\'
+match 1 x '-\' '*-\\'
 match 1 1 'foo' 'foo'
 match 1 1 '@foo' '@foo'
 match 0 0 'foo' '@foo'
@@ -187,8 +187,8 @@ match 0 0 '-' '[[-\]]'
 match 1 1 '-adobe-courier-bold-o-normal--12-120-75-75-m-70-iso8859-1' '-*-*-*-*-*-*-12-*-*-*-m-*-*-*'
 match 0 0 '-adobe-courier-bold-o-normal--12-120-75-75-X-70-iso8859-1' '-*-*-*-*-*-*-12-*-*-*-m-*-*-*'
 match 0 0 '-adobe-courier-bold-o-normal--12-120-75-75-/-70-iso8859-1' '-*-*-*-*-*-*-12-*-*-*-m-*-*-*'
-match 1 1 '/adobe/courier/bold/o/normal//12/120/75/75/m/70/iso8859/1' '/*/*/*/*/*/*/12/*/*/*/m/*/*/*'
-match 0 0 '/adobe/courier/bold/o/normal//12/120/75/75/X/70/iso8859/1' '/*/*/*/*/*/*/12/*/*/*/m/*/*/*'
+match 1 1 'adobe/courier/bold/o/normal//12/120/75/75/m/70/iso8859/1' '*/*/*/*/*/*/12/*/*/*/m/*/*/*'
+match 0 0 'adobe/courier/bold/o/normal//12/120/75/75/X/70/iso8859/1' '*/*/*/*/*/*/12/*/*/*/m/*/*/*'
 match 1 0 'abcd/abcdefg/abcdefghijk/abcdefghijklmnop.txt' '**/*a*b*g*n*t'
 match 0 0 'abcd/abcdefg/abcdefghijk/abcdefghijklmnop.txtz' '**/*a*b*g*n*t'
 
-- 
1.8.0.rc0.45.g6c9d890