From e6e7530d10b74d763b4311ea93e0a831b810d6c2 Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Wed, 13 Apr 2016 20:22:42 +0700 Subject: test helpers: move test-* to t/helper/ subdirectory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This keeps top dir a bit less crowded. And because these programs are for testing purposes, it makes sense that they stay somewhere in t/ Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- test-urlmatch-normalization.c | 50 ------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 test-urlmatch-normalization.c (limited to 'test-urlmatch-normalization.c') diff --git a/test-urlmatch-normalization.c b/test-urlmatch-normalization.c deleted file mode 100644 index 090bf219a7..0000000000 --- a/test-urlmatch-normalization.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "git-compat-util.h" -#include "urlmatch.h" - -int main(int argc, char **argv) -{ - const char usage[] = "test-urlmatch-normalization [-p | -l] | "; - char *url1, *url2; - int opt_p = 0, opt_l = 0; - - /* - * For one url, succeed if url_normalize succeeds on it, fail otherwise. - * For two urls, succeed only if url_normalize succeeds on both and - * the results compare equal with strcmp. If -p is given (one url only) - * and url_normalize succeeds, print the result followed by "\n". If - * -l is given (one url only) and url_normalize succeeds, print the - * returned length in decimal followed by "\n". - */ - - if (argc > 1 && !strcmp(argv[1], "-p")) { - opt_p = 1; - argc--; - argv++; - } else if (argc > 1 && !strcmp(argv[1], "-l")) { - opt_l = 1; - argc--; - argv++; - } - - if (argc < 2 || argc > 3) - die("%s", usage); - - if (argc == 2) { - struct url_info info; - url1 = url_normalize(argv[1], &info); - if (!url1) - return 1; - if (opt_p) - printf("%s\n", url1); - if (opt_l) - printf("%u\n", (unsigned)info.url_len); - return 0; - } - - if (opt_p || opt_l) - die("%s", usage); - - url1 = url_normalize(argv[1], NULL); - url2 = url_normalize(argv[2], NULL); - return (url1 && url2 && !strcmp(url1, url2)) ? 0 : 1; -} -- cgit v1.2.3