summary refs log tree commit diff
path: root/www/git.causal.agency/cgit/tests/t0105-commit.sh
blob: cfed1e7d6933e4f748d1a0cc31383d451108116b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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 "<pre class=.commit-msg.></pre>" 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,64\}.>file-1</a>" tmp
'

test_expect_success 'root commit contains diff' '
	grep ">diff --git a/file-1 b/file-1" tmp &&
	grep "<span class=.add.>+1</span>" tmp
'

test_done
rl/commit/ui.c?h=vimode&id=9a69869d392ca9ac9e2d845dec5f4dfecdbf3456&follow=1'>Add IRCDefault to colors enumJune McEnroe 2018-09-13Return a format->split even at the end of the stringJune McEnroe 2018-09-13Fix weird tab-complete after commaJune McEnroe 2018-09-13Rewrite UI againJune McEnroe 2018-09-12Add note about C-oJune McEnroe 2018-09-12Use formatParse split to position input cursorJune McEnroe 2018-09-12Factor out IRC formatting parsingJune McEnroe 2018-09-11Add /help equivalent to /manJune McEnroe 2018-09-11Don't render every PM as a pingJune McEnroe 2018-09-11Add urlOpenMatchJune McEnroe 2018-09-10Depend on man.sh for chroot.tar targetJune McEnroe 2018-09-10Set LESSSECURE=1 in man.shJune McEnroe 2018-09-10Add /man commandJune McEnroe 2018-09-10Install man page in chrootJune McEnroe 2018-09-10Install man pageJune McEnroe 2018-09-10Split keys into subsections and document colorsJune McEnroe 2018-09-10Add "blank" lines to chatte.1June McEnroe 2018-09-10Document key bindings in chatte.1June McEnroe 2018-09-08Document slash commands in chatte.1June McEnroe