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