X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/a61871a18ffa9fc28e7ab0950415404350c8c857..refs/heads/main:/tests/t0105-commit.sh diff --git a/tests/t0105-commit.sh b/tests/t0105-commit.sh index ae794c8..1a12ee3 100755 --- a/tests/t0105-commit.sh +++ b/tests/t0105-commit.sh @@ -1,37 +1,36 @@ #!/bin/sh +test_description='Check content on commit page' . ./setup.sh -prepare_tests "Check content on commit page" +test_expect_success 'generate foo/commit' 'cgit_url "foo/commit" >tmp' +test_expect_success 'find tree link' 'grep "" tmp' +test_expect_success 'find parent link' 'grep -E "" tmp' -run_test 'generate foo/commit' 'cgit_url "foo/commit" >trash/tmp' -run_test 'find tree link' 'grep -e "" trash/tmp' -run_test 'find parent link' 'grep -E "" trash/tmp' - -run_test 'find commit subject' ' - grep -e "
commit 5<" trash/tmp +test_expect_success 'find commit subject' ' + grep "
commit 5<" tmp ' -run_test 'find commit msg' 'grep -e "
" trash/tmp' -run_test 'find diffstat' 'grep -e "" trash/tmp' +test_expect_success 'find commit msg' 'grep "
" tmp' +test_expect_success 'find diffstat' 'grep "
" tmp' -run_test 'find diff summary' ' - grep -e "1 files changed, 1 insertions, 0 deletions" trash/tmp +test_expect_success 'find diff summary' ' + grep "1 files changed, 1 insertions, 0 deletions" tmp ' -run_test 'get root commit' ' - root=$(cd trash/repos/foo && git rev-list --reverse HEAD | head -1) && - cgit_url "foo/commit&id=$root" >trash/tmp && - grep "" trash/tmp +test_expect_success 'get root commit' ' + root=$(cd repos/foo && git rev-list --reverse HEAD | head -1) && + cgit_url "foo/commit&id=$root" >tmp && + grep "" tmp ' -run_test 'root commit contains diffstat' ' - grep "file-1" trash/tmp +test_expect_success 'root commit contains diffstat' ' + grep "file-1" tmp ' -run_test 'root commit contains diff' ' - grep ">diff --git a/file-1 b/file-1<" trash/tmp && - grep -e "
+1
" trash/tmp +test_expect_success 'root commit contains diff' ' + grep ">diff --git a/file-1 b/file-1<" tmp && + grep "
+1
" tmp ' -tests_done +test_done