Signed-off-by: Nguyễn Thái Ngọc Duy
---
Makefile | 2 +-
t/helper/test-tool.c | 1 +
t/helper/test-tool.h | 1 +
t/helper/test-urlmatch-normalization.c | 5 +-
t/t0110-urlmatch-normalization.sh | 266 -
5 files changed, 139 insertions(+), 136 deletions(-)
diff --git a/Makefile b/Makefile
index 893ea64ca2..7923ec3747 100644
--- a/Makefile
+++ b/Makefile
@@ -684,6 +684,7 @@ TEST_BUILTINS_OBJS += test-strcmp-offset.o
TEST_BUILTINS_OBJS += test-string-list.o
TEST_BUILTINS_OBJS += test-submodule-config.o
TEST_BUILTINS_OBJS += test-subprocess.o
+TEST_BUILTINS_OBJS += test-urlmatch-normalization.o
TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
@@ -693,7 +694,6 @@ TEST_PROGRAMS_NEED_X += test-parse-options
TEST_PROGRAMS_NEED_X += test-write-cache
TEST_PROGRAMS_NEED_X += test-svn-fe
TEST_PROGRAMS_NEED_X += test-tool
-TEST_PROGRAMS_NEED_X += test-urlmatch-normalization
TEST_PROGRAMS_NEED_X += test-wildmatch
TEST_PROGRAMS = $(patsubst %,t/helper/%$X,$(TEST_PROGRAMS_NEED_X))
diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c
index 49f4d6f901..f2d60af898 100644
--- a/t/helper/test-tool.c
+++ b/t/helper/test-tool.c
@@ -39,6 +39,7 @@ static struct test_cmd cmds[] = {
{ "string-list", test_string_list },
{ "submodule-config", test_submodule_config },
{ "subprocess", test_subprocess },
+ { "urlmatch-normalization", test_urlmatch_normalization },
};
int cmd_main(int argc, const char **argv)
diff --git a/t/helper/test-tool.h b/t/helper/test-tool.h
index eaf15cbd84..704ac9df35 100644
--- a/t/helper/test-tool.h
+++ b/t/helper/test-tool.h
@@ -33,5 +33,6 @@ int test_strcmp_offset(int argc, const char **argv);
int test_string_list(int argc, const char **argv);
int test_submodule_config(int argc, const char **argv);
int test_subprocess(int argc, const char **argv);
+int test_urlmatch_normalization(int argc, const char **argv);
#endif
diff --git a/t/helper/test-urlmatch-normalization.c
b/t/helper/test-urlmatch-normalization.c
index 49b6e836be..8edd4da7e1 100644
--- a/t/helper/test-urlmatch-normalization.c
+++ b/t/helper/test-urlmatch-normalization.c
@@ -1,9 +1,10 @@
+#include "test-tool.h"
#include "git-compat-util.h"
#include "urlmatch.h"
-int cmd_main(int argc, const char **argv)
+int test_urlmatch_normalization(int argc, const char **argv)
{
- const char usage[] = "test-urlmatch-normalization [-p | -l] |
";
+ const char usage[] = "test-tool urlmatch-normalization [-p | -l]
| ";
char *url1, *url2;
int opt_p = 0, opt_l = 0;
diff --git a/t/t0110-urlmatch-normalization.sh
b/t/t0110-urlmatch-normalization.sh
index 410d5768ca..f99529d838 100755
--- a/t/t0110-urlmatch-normalization.sh
+++ b/t/t0110-urlmatch-normalization.sh
@@ -9,172 +9,172 @@ tu="$TEST_DIRECTORY/t0110/url"
# Note that only file: URLs should be allowed without a host
test_expect_success 'url scheme' '
- ! test-urlmatch-normalization "" &&
- ! test-urlmatch-normalization "_" &&
- ! test-urlmatch-normalization "scheme" &&
- ! test-urlmatch-normalization "scheme:" &&
- ! test-urlmatch-normalization "scheme:/" &&
- ! test-urlmatch-normalization "scheme://" &&
- ! test-urlmatch-normalization "file" &&
- ! test-urlmatch-normalization "file:" &&
- ! test-urlmatch-normalization "file:/" &&
- test-urlmatch-normalization "file://" &&
- ! test-urlmatch-normalization "://acme.co" &&
- ! test-urlmatch-normalization "x_test://acme.co" &&
- ! test-urlmatch-normalization "-test://acme.co" &&
- ! test-urlmatch-normalization "0test://acme.co" &&
- ! test-urlmatch-normalization "+test://acme.co" &&
- ! test-urlmatch-normalization ".test://acme.co" &&
- ! test-urlmatch-normalization "schem%6e://" &&
- test-urlmatch-normalization "x-Test+v1.0://acme.co" &&
- test "$(test-urlmatch-normalization -p "AbCdeF://x.Y")" =
"abcdef://x.y/"
+ ! test-tool urlmatch-normalization "" &&
+ ! test-tool urlmatch-normalization "_" &&
+ ! test-tool urlmatch-normalization "scheme" &&
+ ! test-tool urlmatch-normalization "scheme:" &&
+ ! test-tool urlmatch-normalization "scheme:/" &&
+ ! test-tool urlmatch-normalization "scheme://" &&
+ ! test-tool urlmatch-normalization "file" &&
+ ! test-tool urlmatch-normalization "file:" &&
+ ! test-tool urlmatch-normalization "file:/" &&
+ test-tool urlmatch-normalization "file://" &&
+ ! test-tool urlmatch-normalization "://acme.co" &&
+ ! test-tool urlmatch-normalization "x_test://acme.co" &&
+ ! test-tool urlmatch-normalization "-test://acme.co" &&
+ ! test-tool urlmatch-normalization "0test://acme.co" &&
+ ! test-tool urlmatch-normalization "+test://acme.co" &&
+ ! test-tool