4 test_description='git web--browse basic tests
6 This test checks that git web--browse can handle various valid URLs.'
11 'URL with an ampersand in it' '
12 echo http://example.com/foo\&bar >expect &&
13 git config browser.custom.cmd echo &&
14 git web--browse --browser=custom \
15 http://example.com/foo\&bar >actual &&
16 test_cmp expect actual
20 'URL with a semi-colon in it' '
21 echo http://example.com/foo\;bar >expect &&
22 git config browser.custom.cmd echo &&
23 git web--browse --browser=custom \
24 http://example.com/foo\;bar >actual &&
25 test_cmp expect actual
29 'URL with a hash in it' '
30 echo http://example.com/foo#bar >expect &&
31 git config browser.custom.cmd echo &&
32 git web--browse --browser=custom \
33 http://example.com/foo#bar >actual &&
34 test_cmp expect actual
38 'browser paths are properly quoted' '
39 echo fake: http://example.com/foo >expect &&
40 cat >"fake browser" <<-\EOF &&
44 chmod +x "fake browser" &&
45 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
52 'browser command allows arbitrary shell code' '
53 echo "arg: http://example.com/foo" >expect &&
54 git config browser.custom.cmd "
61 git web--browse --browser=custom \
62 http://example.com/foo >actual &&
63 test_cmp expect actual