Diff options
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0102-summary.sh | 16 |
1 file changed, 16 insertions, 0 deletions
diff --git a/tests/t0102-summary.sh b/tests/t0102-summary.sh index b31d476..632698c 100755 --- a/tests/t0102-summary.sh +++ b/tests/t0102-summary.sh @@ -69,6 +69,22 @@ test_expect_success 'clone-prefix gives a clone url per prefix' ' test_grep "clone-url.><a rel=.vcs-git. title=.foo Git repository. href=.https://a/foo.>git://b/foo</a>" tmp ' +# The list is split into its templates before each is expanded, so a space in +# the repository url stays inside one clone url, in the rows and in the head +# alike. A clone-prefix has the url joined to it after the split. +test_expect_success 'a space in the repository url stays inside one clone url' ' + cgit_ok_url "with+space" >tmp && + test_grep "clone-url.><a rel=.vcs-git. title=.with space Git repository. href=./with%20space/.>git://example.org/with space.git</a>" tmp && + test $(grep -c "class=.clone-url." tmp) = 1 && + test_grep "<link rel=.vcs-git. href=.git://example.org/with.*space\.git. title=.with space Git repository.>" tmp && + test $(grep -c "<link rel=.vcs-git." tmp) = 1 && + cgitrc_repo spacerc "with space" "clone-prefix=https://a git://b" && + cgit_ok spacerc "url=with+space" >tmp && + test_grep ">https://a/with space</a>" tmp && + test_grep ">git://b/with space</a>" tmp && + test $(grep -c "class=.clone-url." tmp) = 2 +' + # A repository can turn the global clone-url off with an empty one of its own. # Neither its summary nor the page an empty repository gets then draws a Clone # heading over no rows. |
