Diff options
Diffstat (limited to 'tests/t0201-filters.sh')
| -rwxr-xr-x | tests/t0201-filters.sh | 31 |
1 file changed, 12 insertions, 19 deletions
diff --git a/tests/t0201-filters.sh b/tests/t0201-filters.sh index f9f1316..feacf31 100755 --- a/tests/t0201-filters.sh +++ b/tests/t0201-filters.sh @@ -14,41 +14,34 @@ do filter_prereq= test "$prefix" = exec || filter_prereq=CGIT_LUA - test_expect_success $filter_prereq "generate filter-$prefix/tree/a%2bb" " - cgit_url 'filter-$prefix/tree/a%2bb' >tmp - " - # Page output is buffered and has to be flushed as stdout is handed # to a filter and back. A missed flush reorders the page rather than # losing any of it, so the test below watches which side of the # filtered text the surrounding markup lands on. - test_expect_success $filter_prereq "check whether the $prefix source filter works" ' + test_expect_success $filter_prereq "the $prefix source filter gets the file name and fills the code cell" ' + cgit_ok_url "filter-$prefix/tree/a%2bb" >tmp && grep "<code>a+b HELLO$" tmp && tr -d "\n" <tmp >flat.out && grep "<code>a+b HELLO</code>" flat.out ' - test_expect_success $filter_prereq "generate filter-$prefix/about/" " - cgit_url 'filter-$prefix/about/' >tmp - " - - test_expect_success $filter_prereq "check whether the $prefix about filter works" ' - grep "<div id='"'"'about'"'"'>a+b /filter-$prefix/tree/ HELLO$" tmp + test_expect_success $filter_prereq "the $prefix about filter gets the readme name and the tree url" ' + cgit_ok_url "filter-$prefix/about/" >tmp && + grep "<div id=.about.>a+b /filter-$prefix/tree/ HELLO$" tmp ' - test_expect_success $filter_prereq "generate filter-$prefix/commit/" " - cgit_url 'filter-$prefix/commit/' >tmp - " - - test_expect_success $filter_prereq "check whether the $prefix commit filter works" ' - grep "<div class='"'"'commit-subject'"'"'>ADD A+B" tmp + test_expect_success $filter_prereq "the $prefix commit filter rewrites the subject" ' + cgit_ok_url "filter-$prefix/commit/" >tmp && + grep "<div class=.commit-subject.>ADD A+B" tmp ' - test_expect_success $filter_prereq "check whether the $prefix email filter works for authors" ' + test_expect_success $filter_prereq "the $prefix email filter gets the author's address and name" ' + cgit_ok_url "filter-$prefix/commit/" >tmp && grep "<author@example.com> commit A U THOR <AUTHOR@EXAMPLE.COM>" tmp ' - test_expect_success $filter_prereq "check whether the $prefix email filter works for committers" ' + test_expect_success $filter_prereq "the $prefix email filter gets the committer's address and name" ' + cgit_ok_url "filter-$prefix/commit/" >tmp && grep "<committer@example.com> commit C O MITTER <COMMITTER@EXAMPLE.COM>" tmp ' done |
