aboutsummaryrefslogtreecommitdiffstats
path: root/tests/t0111-filter.sh
diff options
context:
space:
mode:
authorGravatar Lukas Fleischer <cgit@cryptocrack.de>2014-01-15 06:25:45 (JST)
committerGravatar Jason A. Donenfeld <Jason@zx2c4.com>2014-01-15 22:45:21 (JST)
commitcaf557a2ba666ad87a1ebd5b40750feaf1bd631f (patch)
tree8de9226af92266c06712bf4b480f19eb679c79a7 /tests/t0111-filter.sh
parent8ae1d8b8fd0b097b10716d0d2d8acaadbd7a46f7 (diff)
downloadcgit-caf557a2ba666ad87a1ebd5b40750feaf1bd631f.zip
cgit-caf557a2ba666ad87a1ebd5b40750feaf1bd631f.tar.gz
t0111: Add basic tests for Lua filters
* Validate the email filter by manipulating stdin. Additional checks for all the arguments can be added in a later patch. * Add the exec prefix to all informational messages. * Rename the filter repository to filter-exec. The Git repository itself is not renamed since it can be shared amongst all filter types. * In the filter checks, check whether all arguments are passed properly instead of validating the buffer/stdin only. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Diffstat (limited to 'tests/t0111-filter.sh')
-rwxr-xr-xtests/t0111-filter.sh65
1 files changed, 34 insertions, 31 deletions
diff --git a/tests/t0111-filter.sh b/tests/t0111-filter.sh
index 2f99880..c89020a 100755
--- a/tests/t0111-filter.sh
+++ b/tests/t0111-filter.sh
@@ -3,36 +3,39 @@
3test_description='Check filtered content' 3test_description='Check filtered content'
4. ./setup.sh 4. ./setup.sh
5 5
6test_expect_success 'generate filter/tree/a%2bb' ' 6for prefix in exec lua
7 cgit_url "filter/tree/a%2bb" >tmp 7do
8' 8 test_expect_success "generate filter-$prefix/tree/a%2bb" "
9 9 cgit_url 'filter-$prefix/tree/a%2bb' >tmp
10test_expect_success 'check whether the source filter works' ' 10 "
11 grep "<code>HELLO$" tmp 11
12' 12 test_expect_success "check whether the $prefix source filter works" '
13 13 grep "<code>a+b HELLO$" tmp
14test_expect_success 'generate filter/about/' ' 14 '
15 cgit_url "filter/about/" >tmp 15
16' 16 test_expect_success "generate filter-$prefix/about/" "
17 17 cgit_url 'filter-$prefix/about/' >tmp
18test_expect_success 'check whether the about filter works' ' 18 "
19 grep "<div id='"'"'summary'"'"'>HELLO$" tmp 19
20' 20 test_expect_success "check whether the $prefix about filter works" '
21 21 grep "<div id='"'"'summary'"'"'>a+b HELLO$" tmp
22test_expect_success 'generate filter/commit/' ' 22 '
23 cgit_url "filter/commit/" >tmp 23
24' 24 test_expect_success "generate filter-$prefix/commit/" "
25 25 cgit_url 'filter-$prefix/commit/' >tmp
26test_expect_success 'check whether the commit filter works' ' 26 "
27 grep "<div class='"'"'commit-subject'"'"'>ADD A+B" tmp 27
28' 28 test_expect_success "check whether the $prefix commit filter works" '
29 29 grep "<div class='"'"'commit-subject'"'"'>ADD A+B" tmp
30test_expect_success 'check whether the email filter works for authors' ' 30 '
31 grep "<AUTHOR@EXAMPLE.COM>" tmp 31
32' 32 test_expect_success "check whether the $prefix email filter works for authors" '
33 33 grep "A U THOR &LT;AUTHOR@EXAMPLE.COM&GT;" tmp
34test_expect_success 'check whether the email filter works for committers' ' 34 '
35 grep "<COMMITTER@EXAMPLE.COM>" tmp 35
36' 36 test_expect_success "check whether the $prefix email filter works for committers" '
37 grep "C O MITTER &LT;COMMITTER@EXAMPLE.COM&GT;" tmp
38 '
39done
37 40
38test_done 41test_done