]> gitweb.ps.run Git - ps-cgit/blob - tests/t0111-filter.sh
t0111: Additions and fixes
[ps-cgit] / tests / t0111-filter.sh
1 #!/bin/sh
2
3 test_description='Check filtered content'
4 . ./setup.sh
5
6 for prefix in exec lua
7 do
8         test_expect_success "generate filter-$prefix/tree/a%2bb" "
9                 cgit_url 'filter-$prefix/tree/a%2bb' >tmp
10         "
11
12         test_expect_success "check whether the $prefix source filter works" '
13                 grep "<code>a+b HELLO$" tmp
14         '
15
16         test_expect_success "generate filter-$prefix/about/" "
17                 cgit_url 'filter-$prefix/about/' >tmp
18         "
19
20         test_expect_success "check whether the $prefix about filter works" '
21                 grep "<div id='"'"'summary'"'"'>a+b HELLO$" tmp
22         '
23
24         test_expect_success "generate filter-$prefix/commit/" "
25                 cgit_url 'filter-$prefix/commit/' >tmp
26         "
27
28         test_expect_success "check whether the $prefix commit filter works" '
29                 grep "<div class='"'"'commit-subject'"'"'>ADD A+B" tmp
30         '
31
32         test_expect_success "check whether the $prefix email filter works for authors" '
33                 grep "<author@example.com> commit A U THOR &LT;AUTHOR@EXAMPLE.COM&GT;" tmp
34         '
35
36         test_expect_success "check whether the $prefix email filter works for committers" '
37                 grep "<committer@example.com> commit C O MITTER &LT;COMMITTER@EXAMPLE.COM&GT;" tmp
38         '
39 done
40
41 test_done