cgit

commit 3741254a6989b2837cd8d20480f152f0096bcb9a

Author: Lukas Fleischer <cgit@cryptocrack.de>

t0111: Additions and fixes

* Rename the capitalize-* filters to dump.* since they also dump the
  arguments.

* Add full argument validation to the email filters.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>

  | 0 
  | 0 
 tests/setup.sh | 16 ++++++++--------
 tests/t0111-filter.sh | 4 ++--


diff --git a/tests/filters/capitalize-buffer.lua b/tests/filters/capitalize-buffer.lua
deleted file mode 100644
index 1f15c931051c31b7908975bf5aafb7e17c3c0b32..0000000000000000000000000000000000000000
--- a/tests/filters/capitalize-buffer.lua
+++ /dev/null
@@ -1,17 +0,0 @@
-function filter_open(...)
-	buffer = ""
-	for i = 1, select("#", ...) do
-		buffer = buffer .. select(i, ...) .. " "
-	end
-end
-
-function filter_close()
-	html(buffer)
-	return 0
-end
-
-function filter_write(str)
-	buffer = buffer .. string.upper(str)
-end
-
-




diff --git a/tests/filters/capitalize-stdin.sh b/tests/filters/capitalize-stdin.sh
deleted file mode 100755
index da6f7a1b181bf4bf6427e75c8d21a27dfb9f0f16..0000000000000000000000000000000000000000
--- a/tests/filters/capitalize-stdin.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-[ "$#" -gt 0 ] && printf "%s " "$*"
-tr '[:lower:]' '[:upper:]'




diff --git a/tests/filters/dump.lua b/tests/filters/dump.lua
new file mode 100644
index 0000000000000000000000000000000000000000..1f15c931051c31b7908975bf5aafb7e17c3c0b32
--- /dev/null
+++ b/tests/filters/dump.lua
@@ -0,0 +1,17 @@
+function filter_open(...)
+	buffer = ""
+	for i = 1, select("#", ...) do
+		buffer = buffer .. select(i, ...) .. " "
+	end
+end
+
+function filter_close()
+	html(buffer)
+	return 0
+end
+
+function filter_write(str)
+	buffer = buffer .. string.upper(str)
+end
+
+




diff --git a/tests/filters/dump.sh b/tests/filters/dump.sh
new file mode 100755
index 0000000000000000000000000000000000000000..da6f7a1b181bf4bf6427e75c8d21a27dfb9f0f16
--- /dev/null
+++ b/tests/filters/dump.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+[ "$#" -gt 0 ] && printf "%s " "$*"
+tr '[:lower:]' '[:upper:]'




diff --git a/tests/setup.sh b/tests/setup.sh
index 12c97f55a1c241dcc1ab6154e6e5512543b2abb2..785edd79565d8334ee0490be1b42c59afc0bab6f 100755
--- a/tests/setup.sh
+++ b/tests/setup.sh
@@ -128,19 +128,19 @@
 repo.url=filter-exec
 repo.path=$PWD/repos/filter/.git
 repo.desc=filtered repo
-repo.about-filter=exec:$FILTER_DIRECTORY/capitalize-stdin.sh
-repo.commit-filter=exec:$FILTER_DIRECTORY/capitalize-stdin.sh
-repo.email-filter=exec:$FILTER_DIRECTORY/capitalize-stdin.sh
-repo.source-filter=exec:$FILTER_DIRECTORY/capitalize-stdin.sh
+repo.about-filter=exec:$FILTER_DIRECTORY/dump.sh
+repo.commit-filter=exec:$FILTER_DIRECTORY/dump.sh
+repo.email-filter=exec:$FILTER_DIRECTORY/dump.sh
+repo.source-filter=exec:$FILTER_DIRECTORY/dump.sh
 repo.readme=master:a+b
 
 repo.url=filter-lua
 repo.path=$PWD/repos/filter/.git
 repo.desc=filtered repo
-repo.about-filter=lua:$FILTER_DIRECTORY/capitalize-buffer.lua
-repo.commit-filter=lua:$FILTER_DIRECTORY/capitalize-buffer.lua
-repo.email-filter=lua:$FILTER_DIRECTORY/capitalize-buffer.lua
-repo.source-filter=lua:$FILTER_DIRECTORY/capitalize-buffer.lua
+repo.about-filter=lua:$FILTER_DIRECTORY/dump.lua
+repo.commit-filter=lua:$FILTER_DIRECTORY/dump.lua
+repo.email-filter=lua:$FILTER_DIRECTORY/dump.lua
+repo.source-filter=lua:$FILTER_DIRECTORY/dump.lua
 repo.readme=master:a+b
 EOF
 }




diff --git a/tests/t0111-filter.sh b/tests/t0111-filter.sh
index c89020aa1f404d6f7990f12ecaa86e0681cc618d..730f1c02a36b70cc64d63b87426d7ef625730fda 100755
--- a/tests/t0111-filter.sh
+++ b/tests/t0111-filter.sh
@@ -30,11 +30,11 @@ 		grep "
ADD A+B" tmp ' test_expect_success "check whether the $prefix email filter works for authors" ' - grep "A U THOR &LT;AUTHOR@EXAMPLE.COM&GT;" tmp + grep "<author@example.com> commit A U THOR &LT;AUTHOR@EXAMPLE.COM&GT;" tmp ' test_expect_success "check whether the $prefix email filter works for committers" ' - grep "C O MITTER &LT;COMMITTER@EXAMPLE.COM&GT;" tmp + grep "<committer@example.com> commit C O MITTER &LT;COMMITTER@EXAMPLE.COM&GT;" tmp ' done