Diff options
Diffstat (limited to '')
| -rwxr-xr-x | tests/t0101-index.sh | 28 |
1 file changed, 7 insertions, 21 deletions
diff --git a/tests/t0101-index.sh b/tests/t0101-index.sh index 8d389b6..2e49ed8 100755 --- a/tests/t0101-index.sh +++ b/tests/t0101-index.sh @@ -11,9 +11,9 @@ test_description='Check content on index page' . ./setup.sh test_expect_success 'generate index page' 'cgit_url "" >tmp' -test_expect_success 'find foo repo' 'grep "foo" tmp' +test_expect_success 'find foo repo' 'grep ">foo</a>" tmp' test_expect_success 'find foo description' 'grep "\[no description\]" tmp' -test_expect_success 'find bar repo' 'grep "bar" tmp' +test_expect_success 'find bar repo' 'grep ">bar</a>" tmp' test_expect_success 'find bar description' 'grep "the bar repo" tmp' test_expect_success 'find foo+bar repo' 'grep ">foo+bar<" tmp' test_expect_success 'verify foo+bar links' 'test $(grep -o "href=./foo%2Bbar/." tmp | wc -l) = 2' @@ -22,23 +22,15 @@ test_expect_success 'no tree-link' '! grep "foo/tree" tmp' test_expect_success 'no log-link' '! grep "foo/log" tmp' test_expect_success 'index links lead to the summary, log and tree' ' - echo "enable-index-links=1" >links-cgitrc && - sed "s/^cache-size=.*/cache-size=0/" cgitrc >>links-cgitrc && - CGIT_CONFIG="$PWD/links-cgitrc" QUERY_STRING="url=" cgit >tmp && + cgitrc_copy links-cgitrc enable-index-links=1 && + cgit_rc links-cgitrc "url=" >tmp && grep ">summary</a><a class=.button. href=./foo/log/.>log</a>" tmp && grep "href=./foo/log/.>log</a><a class=.button. href=./foo/tree/.>tree<" tmp ' test_expect_success 'each css and js entry gets a link of its own' ' - { - echo "css=/a.css" && - echo "css=/b.css" && - echo "js=/a.js" && - echo "js=" && - echo "js=/b.js" - } >headrc && - sed "s/^cache-size=.*/cache-size=0/" cgitrc >>headrc && - CGIT_CONFIG="$PWD/headrc" QUERY_STRING="url=" cgit >tmp && + cgitrc_copy headrc css=/a.css css=/b.css js=/a.js js= js=/b.js && + cgit_rc headrc "url=" >tmp && grep "<link rel=.stylesheet. href=./a.css.>" tmp && grep "<link rel=.stylesheet. href=./b.css.>" tmp && grep "<script src=" tmp >scripts && @@ -47,12 +39,6 @@ test_expect_success 'each css and js entry gets a link of its own' ' grep "/b.js" scripts ' -test_expect_success 'the feed link encodes the repository and the branch' ' - sed "s/^cache-size=.*/cache-size=0/" cgitrc >feedrc && - CGIT_CONFIG="$PWD/feedrc" HTTP_HOST=example.org QUERY_STRING="url=foo%2Bbar/log/&h=1%2B2" cgit >tmp && - grep "title=.Atom feed. href=.http://example.org/foo%2Bbar/atom/?h=1%2B2." tmp -' - # The description limit counts bytes, so a cut has to land between # characters rather than leave half of one on the page. test_expect_success 'a cut description keeps whole characters' ' @@ -63,7 +49,7 @@ test_expect_success 'a cut description keeps whole characters' ' echo "repo.path=$PWD/repos/foo/.git" && echo "repo.desc=日本語の説明文です" } >descrc && - CGIT_CONFIG="$PWD/descrc" QUERY_STRING="url=" cgit >tmp && + cgit_rc descrc "url=" >tmp && grep ">日本語\.\.\.</a>" tmp ' |
