merge(third_party/cgit): Import at master of 2020-01-11
Imported commit '723dc8fbcb' as
'third_party/cgit'.
This commit is contained in:
commit
5a069d5888
102 changed files with 15632 additions and 0 deletions
36
third_party/cgit/tests/t0105-commit.sh
vendored
Executable file
36
third_party/cgit/tests/t0105-commit.sh
vendored
Executable file
|
|
@ -0,0 +1,36 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='Check content on commit page'
|
||||
. ./setup.sh
|
||||
|
||||
test_expect_success 'generate foo/commit' 'cgit_url "foo/commit" >tmp'
|
||||
test_expect_success 'find tree link' 'grep "<a href=./foo/tree/.>" tmp'
|
||||
test_expect_success 'find parent link' 'grep -E "<a href=./foo/commit/\?id=.+>" tmp'
|
||||
|
||||
test_expect_success 'find commit subject' '
|
||||
grep "<div class=.commit-subject.>commit 5<" tmp
|
||||
'
|
||||
|
||||
test_expect_success 'find commit msg' 'grep "<div class=.commit-msg.></div>" tmp'
|
||||
test_expect_success 'find diffstat' 'grep "<table summary=.diffstat. class=.diffstat.>" tmp'
|
||||
|
||||
test_expect_success 'find diff summary' '
|
||||
grep "1 files changed, 1 insertions, 0 deletions" 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 "</html>" tmp
|
||||
'
|
||||
|
||||
test_expect_success 'root commit contains diffstat' '
|
||||
grep "<a href=./foo/diff/file-1.id=[0-9a-f]\{40\}.>file-1</a>" tmp
|
||||
'
|
||||
|
||||
test_expect_success 'root commit contains diff' '
|
||||
grep ">diff --git a/file-1 b/file-1<" tmp &&
|
||||
grep "<div class=.add.>+1</div>" tmp
|
||||
'
|
||||
|
||||
test_done
|
||||
Loading…
Add table
Add a link
Reference in a new issue