Skip to content

Commit f64943d

Browse files
patthoytsgitster
authored andcommitted
t9901: fix line-ending dependency on windows
Signed-off-by: Pat Thoyts <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 13d24b0 commit f64943d

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

t/t9901-git-web--browse.sh

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,32 @@ This test checks that git web--browse can handle various valid URLs.'
77

88
. ./test-lib.sh
99

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+
1017
test_expect_success \
1118
'URL with an ampersand in it' '
1219
echo http://example.com/foo\&bar >expect &&
1320
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
1722
'
1823

1924
test_expect_success \
2025
'URL with a semi-colon in it' '
2126
echo http://example.com/foo\;bar >expect &&
2227
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
2629
'
2730

2831
test_expect_success \
2932
'URL with a hash in it' '
3033
echo http://example.com/foo#bar >expect &&
3134
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
3536
'
3637

3738
test_expect_success \
@@ -43,9 +44,7 @@ test_expect_success \
4344
EOF
4445
chmod +x "fake browser" &&
4546
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
4948
'
5049

5150
test_expect_success \
@@ -58,9 +57,7 @@ test_expect_success \
5857
done
5958
}
6059
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
6461
'
6562

6663
test_done

0 commit comments

Comments
 (0)