diff options
Diffstat (limited to 'tests/t0105-commit.sh')
-rwxr-xr-x | tests/t0105-commit.sh | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/tests/t0105-commit.sh b/tests/t0105-commit.sh index 31b554b..9cdf55c 100755 --- a/tests/t0105-commit.sh +++ b/tests/t0105-commit.sh | |||
@@ -1,37 +1,36 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | test_description='Check content on commit page' | ||
3 | . ./setup.sh | 4 | . ./setup.sh |
4 | 5 | ||
5 | prepare_tests "Check content on commit page" | 6 | test_expect_success 'generate foo/commit' 'cgit_url "foo/commit" >tmp' |
7 | test_expect_success 'find tree link' 'grep "<a href=./foo/tree/.>" tmp' | ||
8 | test_expect_success 'find parent link' 'grep -E "<a href=./foo/commit/\?id=.+>" tmp' | ||
6 | 9 | ||
7 | run_test 'generate foo/commit' 'cgit_url "foo/commit" >trash/tmp' | 10 | test_expect_success 'find commit subject' ' |
8 | run_test 'find tree link' 'grep "<a href=./foo/tree/.>" trash/tmp' | 11 | grep "<div class=.commit-subject.>commit 5<" tmp |
9 | run_test 'find parent link' 'grep -E "<a href=./foo/commit/\?id=.+>" trash/tmp' | ||
10 | |||
11 | run_test 'find commit subject' ' | ||
12 | grep "<div class=.commit-subject.>commit 5<" trash/tmp | ||
13 | ' | 12 | ' |
14 | 13 | ||
15 | run_test 'find commit msg' 'grep "<div class=.commit-msg.></div>" trash/tmp' | 14 | test_expect_success 'find commit msg' 'grep "<div class=.commit-msg.></div>" tmp' |
16 | run_test 'find diffstat' 'grep "<table summary=.diffstat. class=.diffstat.>" trash/tmp' | 15 | test_expect_success 'find diffstat' 'grep "<table summary=.diffstat. class=.diffstat.>" tmp' |
17 | 16 | ||
18 | run_test 'find diff summary' ' | 17 | test_expect_success 'find diff summary' ' |
19 | grep "1 files changed, 1 insertions, 0 deletions" trash/tmp | 18 | grep "1 files changed, 1 insertions, 0 deletions" tmp |
20 | ' | 19 | ' |
21 | 20 | ||
22 | run_test 'get root commit' ' | 21 | test_expect_success 'get root commit' ' |
23 | root=$(cd trash/repos/foo && git rev-list --reverse HEAD | head -1) && | 22 | root=$(cd repos/foo && git rev-list --reverse HEAD | head -1) && |
24 | cgit_url "foo/commit&id=$root" >trash/tmp && | 23 | cgit_url "foo/commit&id=$root" >tmp && |
25 | grep "</html>" trash/tmp | 24 | grep "</html>" tmp |
26 | ' | 25 | ' |
27 | 26 | ||
28 | run_test 'root commit contains diffstat' ' | 27 | test_expect_success 'root commit contains diffstat' ' |
29 | grep "<a href=./foo/diff/file-1.id=[0-9a-f]\{40\}.>file-1</a>" trash/tmp | 28 | grep "<a href=./foo/diff/file-1.id=[0-9a-f]\{40\}.>file-1</a>" tmp |
30 | ' | 29 | ' |
31 | 30 | ||
32 | run_test 'root commit contains diff' ' | 31 | test_expect_success 'root commit contains diff' ' |
33 | grep ">diff --git a/file-1 b/file-1<" trash/tmp && | 32 | grep ">diff --git a/file-1 b/file-1<" tmp && |
34 | grep "<div class=.add.>+1</div>" trash/tmp | 33 | grep "<div class=.add.>+1</div>" tmp |
35 | ' | 34 | ' |
36 | 35 | ||
37 | tests_done | 36 | test_done |