about summary refs log tree commit diff stats
path: root/tests/t0105-commit.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/t0105-commit.sh')
-rwxr-xr-xtests/t0105-commit.sh41
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
3test_description='Check content on commit page'
3. ./setup.sh 4. ./setup.sh
4 5
5prepare_tests "Check content on commit page" 6test_expect_success 'generate foo/commit' 'cgit_url "foo/commit" >tmp'
7test_expect_success 'find tree link' 'grep "<a href=./foo/tree/.>" tmp'
8test_expect_success 'find parent link' 'grep -E "<a href=./foo/commit/\?id=.+>" tmp'
6 9
7run_test 'generate foo/commit' 'cgit_url "foo/commit" >trash/tmp' 10test_expect_success 'find commit subject' '
8run_test 'find tree link' 'grep "<a href=./foo/tree/.>" trash/tmp' 11 grep "<div class=.commit-subject.>commit 5<" tmp
9run_test 'find parent link' 'grep -E "<a href=./foo/commit/\?id=.+>" trash/tmp'
10
11run_test 'find commit subject' '
12 grep "<div class=.commit-subject.>commit 5<" trash/tmp
13' 12'
14 13
15run_test 'find commit msg' 'grep "<div class=.commit-msg.></div>" trash/tmp' 14test_expect_success 'find commit msg' 'grep "<div class=.commit-msg.></div>" tmp'
16run_test 'find diffstat' 'grep "<table summary=.diffstat. class=.diffstat.>" trash/tmp' 15test_expect_success 'find diffstat' 'grep "<table summary=.diffstat. class=.diffstat.>" tmp'
17 16
18run_test 'find diff summary' ' 17test_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
22run_test 'get root commit' ' 21test_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
28run_test 'root commit contains diffstat' ' 27test_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
32run_test 'root commit contains diff' ' 31test_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
37tests_done 36test_done