4 test_description
='git web--browse basic tests
6 This test checks that git web--browse can handle various valid URLs.'
8 TEST_PASSES_SANITIZE_LEAK
=true
13 git web--browse
--browser="$1" "$2" >actual
&&
14 tr -d '\015' <actual
>text
&&
19 'URL with an ampersand in it' '
20 echo http://example.com/foo\&bar >expect &&
21 git config browser.custom.cmd echo &&
22 test_web_browse custom http://example.com/foo\&bar
26 'URL with a semi-colon in it' '
27 echo http://example.com/foo\;bar >expect &&
28 git config browser.custom.cmd echo &&
29 test_web_browse custom http://example.com/foo\;bar
33 'URL with a hash in it' '
34 echo http://example.com/foo#bar >expect &&
35 git config browser.custom.cmd echo &&
36 test_web_browse custom http://example.com/foo#bar
40 'browser paths are properly quoted' '
41 echo fake: http://example.com/foo >expect &&
42 cat >"fake browser" <<-\EOF &&
46 chmod +x "fake browser" &&
47 git config browser.w3m.path "$(pwd)/fake browser" &&
48 test_web_browse w3m http://example.com/foo
52 'browser command allows arbitrary shell code' '
53 echo "arg: http://example.com/foo" >expect &&
54 git config browser.custom.cmd "
61 test_web_browse custom http://example.com/foo