]> git.cameronkatri.com Git - cgit.git/blob - tests/t0108-patch.sh
tests: use Git's test framework
[cgit.git] / tests / t0108-patch.sh
1 #!/bin/sh
2
3 test_description='Check content on patch page'
4 . ./setup.sh
5
6 test_expect_success 'generate foo/patch' '
7 cgit_query "url=foo/patch" >tmp
8 '
9
10 test_expect_success 'find `From:` line' '
11 grep "^From: " tmp
12 '
13
14 test_expect_success 'find `Date:` line' '
15 grep "^Date: " tmp
16 '
17
18 test_expect_success 'find `Subject:` line' '
19 grep "^Subject: commit 5" tmp
20 '
21
22 test_expect_success 'find `cgit` signature' '
23 tail -1 tmp | grep "^cgit"
24 '
25
26 test_expect_success 'find initial commit' '
27 root=$(git --git-dir="$PWD/repos/foo/.git" rev-list HEAD | tail -1)
28 '
29
30 test_expect_success 'generate patch for initial commit' '
31 cgit_query "url=foo/patch&id=$root" >tmp
32 '
33
34 test_expect_success 'find `cgit` signature' '
35 tail -1 tmp | grep "^cgit"
36 '
37
38 test_done