t9901: fix line-ending dependency on windows

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Pat Thoyts committed Oct 15, 2011 at 15:05 UTC f64943d242d3b0fff40684d09033f17bb9747a38
1 file changed +12 -15
t/t9901-git-web--browse.sh
+12 -15
@@ -7,31 +7,32 @@ This test checks that git web--browse can handle various valid URLs.'
7
8 . ./test-lib.sh
9
10 +test_web_browse () {
11 + # browser=$1 url=$2
12 + git web--browse --browser="$1" "$2" >actual &&
13 + tr -d '\015' <actual >text &&
14 + test_cmp expect text
15 +}
16 +
17 test_expect_success \
18 'URL with an ampersand in it' '
19 echo http://example.com/foo\&bar >expect &&
20 git config browser.custom.cmd echo &&
14 - git web--browse --browser=custom \
15 - http://example.com/foo\&bar >actual &&
16 - test_cmp expect actual
21 + test_web_browse custom http://example.com/foo\&bar
22 '
23
24 test_expect_success \
25 'URL with a semi-colon in it' '
26 echo http://example.com/foo\;bar >expect &&
27 git config browser.custom.cmd echo &&
23 - git web--browse --browser=custom \
24 - http://example.com/foo\;bar >actual &&
25 - test_cmp expect actual
28 + test_web_browse custom http://example.com/foo\;bar
29 '
30
31 test_expect_success \
32 'URL with a hash in it' '
33 echo http://example.com/foo#bar >expect &&
34 git config browser.custom.cmd echo &&
32 - git web--browse --browser=custom \
33 - http://example.com/foo#bar >actual &&
34 - test_cmp expect actual
35 + test_web_browse custom http://example.com/foo#bar
36 '
37
38 test_expect_success \
@@ -43,9 +44,7 @@ test_expect_success \
44 EOF
45 chmod +x "fake browser" &&
46 git config browser.w3m.path "`pwd`/fake browser" &&
46 - git web--browse --browser=w3m \
47 - http://example.com/foo >actual &&
48 - test_cmp expect actual
47 + test_web_browse w3m http://example.com/foo
48 '
49
50 test_expect_success \
@@ -58,9 +57,7 @@ test_expect_success \
57 done
58 }
59 f" &&
61 - git web--browse --browser=custom \
62 - http://example.com/foo >actual &&
63 - test_cmp expect actual
60 + test_web_browse custom http://example.com/foo
61 '
62
63 test_done