In the filter checks, check whether all arguments are passed properly
instead of validating the buffer/stdin only.

Signed-off-by: Lukas Fleischer <[email protected]>
---
 tests/filters/capitalize-buffer.lua | 3 +++
 tests/filters/capitalize-stdin.sh   | 1 +
 tests/t0111-filter.sh               | 4 ++--
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/filters/capitalize-buffer.lua 
b/tests/filters/capitalize-buffer.lua
index 7ca4ec6..1f15c93 100644
--- a/tests/filters/capitalize-buffer.lua
+++ b/tests/filters/capitalize-buffer.lua
@@ -1,5 +1,8 @@
 function filter_open(...)
        buffer = ""
+       for i = 1, select("#", ...) do
+               buffer = buffer .. select(i, ...) .. " "
+       end
 end
 
 function filter_close()
diff --git a/tests/filters/capitalize-stdin.sh 
b/tests/filters/capitalize-stdin.sh
index c9f4719..da6f7a1 100755
--- a/tests/filters/capitalize-stdin.sh
+++ b/tests/filters/capitalize-stdin.sh
@@ -1,3 +1,4 @@
 #!/bin/sh
 
+[ "$#" -gt 0 ] && printf "%s " "$*"
 tr '[:lower:]' '[:upper:]'
diff --git a/tests/t0111-filter.sh b/tests/t0111-filter.sh
index dab6aa8..c89020a 100755
--- a/tests/t0111-filter.sh
+++ b/tests/t0111-filter.sh
@@ -10,7 +10,7 @@ do
        "
 
        test_expect_success "check whether the $prefix source filter works" '
-               grep "<code>HELLO$" tmp
+               grep "<code>a+b HELLO$" tmp
        '
 
        test_expect_success "generate filter-$prefix/about/" "
@@ -18,7 +18,7 @@ do
        "
 
        test_expect_success "check whether the $prefix about filter works" '
-               grep "<div id='"'"'summary'"'"'>HELLO$" tmp
+               grep "<div id='"'"'summary'"'"'>a+b HELLO$" tmp
        '
 
        test_expect_success "generate filter-$prefix/commit/" "
-- 
1.8.5.2

_______________________________________________
CGit mailing list
[email protected]
http://lists.zx2c4.com/mailman/listinfo/cgit

Reply via email to