all repos — cgit @ v1.2.3pl14

a hyperfast web frontend for git written in c

tests/t0111-filter.sh (view raw)

 1#!/bin/sh
 2
 3test_description='Check filtered content'
 4. ./setup.sh
 5
 6prefixes="exec"
 7if [ $CGIT_HAS_LUA -eq 1 ]; then
 8	prefixes="$prefixes lua"
 9fi
10
11for prefix in $prefixes
12do
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	'
44done
45
46test_done