From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH 34/36] t/helper: merge test-urlmatch-.. into test-tool
Date: Sat, 17 Mar 2018 08:54:19 +0100 [thread overview]
Message-ID: <20180317075421.22032-35-pclouds@gmail.com> (raw)
In-Reply-To: <20180317075421.22032-1-pclouds@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
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] <url1> | <url1> <url2>";
+ const char usage[] = "test-tool urlmatch-normalization [-p | -l] <url1> | <url1> <url2>";
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 urlmatch-normalization ".test://acme.co" &&
+ ! test-tool urlmatch-normalization "schem%6e://" &&
+ test-tool urlmatch-normalization "x-Test+v1.0://acme.co" &&
+ test "$(test-tool urlmatch-normalization -p "AbCdeF://x.Y")" = "abcdef://x.y/"
'
test_expect_success 'url authority' '
- ! test-urlmatch-normalization "scheme://user:pass@" &&
- ! test-urlmatch-normalization "scheme://?" &&
- ! test-urlmatch-normalization "scheme://#" &&
- ! test-urlmatch-normalization "scheme:///" &&
- ! test-urlmatch-normalization "scheme://:" &&
- ! test-urlmatch-normalization "scheme://:555" &&
- test-urlmatch-normalization "file://user:pass@" &&
- test-urlmatch-normalization "file://?" &&
- test-urlmatch-normalization "file://#" &&
- test-urlmatch-normalization "file:///" &&
- test-urlmatch-normalization "file://:" &&
- ! test-urlmatch-normalization "file://:555" &&
- test-urlmatch-normalization "scheme://user:pass@host" &&
- test-urlmatch-normalization "scheme://@host" &&
- test-urlmatch-normalization "scheme://%00@host" &&
- ! test-urlmatch-normalization "scheme://%%@host" &&
- ! test-urlmatch-normalization "scheme://host_" &&
- test-urlmatch-normalization "scheme://user:pass@host/" &&
- test-urlmatch-normalization "scheme://@host/" &&
- test-urlmatch-normalization "scheme://host/" &&
- test-urlmatch-normalization "scheme://host?x" &&
- test-urlmatch-normalization "scheme://host#x" &&
- test-urlmatch-normalization "scheme://host/@" &&
- test-urlmatch-normalization "scheme://host?@x" &&
- test-urlmatch-normalization "scheme://host#@x" &&
- test-urlmatch-normalization "scheme://[::1]" &&
- test-urlmatch-normalization "scheme://[::1]/" &&
- ! test-urlmatch-normalization "scheme://hos%41/" &&
- test-urlmatch-normalization "scheme://[invalid....:/" &&
- test-urlmatch-normalization "scheme://invalid....:]/" &&
- ! test-urlmatch-normalization "scheme://invalid....:[/" &&
- ! test-urlmatch-normalization "scheme://invalid....:["
+ ! test-tool urlmatch-normalization "scheme://user:pass@" &&
+ ! test-tool urlmatch-normalization "scheme://?" &&
+ ! test-tool urlmatch-normalization "scheme://#" &&
+ ! test-tool urlmatch-normalization "scheme:///" &&
+ ! test-tool urlmatch-normalization "scheme://:" &&
+ ! test-tool urlmatch-normalization "scheme://:555" &&
+ test-tool urlmatch-normalization "file://user:pass@" &&
+ test-tool urlmatch-normalization "file://?" &&
+ test-tool urlmatch-normalization "file://#" &&
+ test-tool urlmatch-normalization "file:///" &&
+ test-tool urlmatch-normalization "file://:" &&
+ ! test-tool urlmatch-normalization "file://:555" &&
+ test-tool urlmatch-normalization "scheme://user:pass@host" &&
+ test-tool urlmatch-normalization "scheme://@host" &&
+ test-tool urlmatch-normalization "scheme://%00@host" &&
+ ! test-tool urlmatch-normalization "scheme://%%@host" &&
+ ! test-tool urlmatch-normalization "scheme://host_" &&
+ test-tool urlmatch-normalization "scheme://user:pass@host/" &&
+ test-tool urlmatch-normalization "scheme://@host/" &&
+ test-tool urlmatch-normalization "scheme://host/" &&
+ test-tool urlmatch-normalization "scheme://host?x" &&
+ test-tool urlmatch-normalization "scheme://host#x" &&
+ test-tool urlmatch-normalization "scheme://host/@" &&
+ test-tool urlmatch-normalization "scheme://host?@x" &&
+ test-tool urlmatch-normalization "scheme://host#@x" &&
+ test-tool urlmatch-normalization "scheme://[::1]" &&
+ test-tool urlmatch-normalization "scheme://[::1]/" &&
+ ! test-tool urlmatch-normalization "scheme://hos%41/" &&
+ test-tool urlmatch-normalization "scheme://[invalid....:/" &&
+ test-tool urlmatch-normalization "scheme://invalid....:]/" &&
+ ! test-tool urlmatch-normalization "scheme://invalid....:[/" &&
+ ! test-tool urlmatch-normalization "scheme://invalid....:["
'
test_expect_success 'url port checks' '
- test-urlmatch-normalization "xyz://q@some.host:" &&
- test-urlmatch-normalization "xyz://q@some.host:456/" &&
- ! test-urlmatch-normalization "xyz://q@some.host:0" &&
- ! test-urlmatch-normalization "xyz://q@some.host:0000000" &&
- test-urlmatch-normalization "xyz://q@some.host:0000001?" &&
- test-urlmatch-normalization "xyz://q@some.host:065535#" &&
- test-urlmatch-normalization "xyz://q@some.host:65535" &&
- ! test-urlmatch-normalization "xyz://q@some.host:65536" &&
- ! test-urlmatch-normalization "xyz://q@some.host:99999" &&
- ! test-urlmatch-normalization "xyz://q@some.host:100000" &&
- ! test-urlmatch-normalization "xyz://q@some.host:100001" &&
- test-urlmatch-normalization "http://q@some.host:80" &&
- test-urlmatch-normalization "https://q@some.host:443" &&
- test-urlmatch-normalization "http://q@some.host:80/" &&
- test-urlmatch-normalization "https://q@some.host:443?" &&
- ! test-urlmatch-normalization "http://q@:8008" &&
- ! test-urlmatch-normalization "http://:8080" &&
- ! test-urlmatch-normalization "http://:" &&
- test-urlmatch-normalization "xyz://q@some.host:456/" &&
- test-urlmatch-normalization "xyz://[::1]:456/" &&
- test-urlmatch-normalization "xyz://[::1]:/" &&
- ! test-urlmatch-normalization "xyz://[::1]:000/" &&
- ! test-urlmatch-normalization "xyz://[::1]:0%300/" &&
- ! test-urlmatch-normalization "xyz://[::1]:0x80/" &&
- ! test-urlmatch-normalization "xyz://[::1]:4294967297/" &&
- ! test-urlmatch-normalization "xyz://[::1]:030f/"
+ test-tool urlmatch-normalization "xyz://q@some.host:" &&
+ test-tool urlmatch-normalization "xyz://q@some.host:456/" &&
+ ! test-tool urlmatch-normalization "xyz://q@some.host:0" &&
+ ! test-tool urlmatch-normalization "xyz://q@some.host:0000000" &&
+ test-tool urlmatch-normalization "xyz://q@some.host:0000001?" &&
+ test-tool urlmatch-normalization "xyz://q@some.host:065535#" &&
+ test-tool urlmatch-normalization "xyz://q@some.host:65535" &&
+ ! test-tool urlmatch-normalization "xyz://q@some.host:65536" &&
+ ! test-tool urlmatch-normalization "xyz://q@some.host:99999" &&
+ ! test-tool urlmatch-normalization "xyz://q@some.host:100000" &&
+ ! test-tool urlmatch-normalization "xyz://q@some.host:100001" &&
+ test-tool urlmatch-normalization "http://q@some.host:80" &&
+ test-tool urlmatch-normalization "https://q@some.host:443" &&
+ test-tool urlmatch-normalization "http://q@some.host:80/" &&
+ test-tool urlmatch-normalization "https://q@some.host:443?" &&
+ ! test-tool urlmatch-normalization "http://q@:8008" &&
+ ! test-tool urlmatch-normalization "http://:8080" &&
+ ! test-tool urlmatch-normalization "http://:" &&
+ test-tool urlmatch-normalization "xyz://q@some.host:456/" &&
+ test-tool urlmatch-normalization "xyz://[::1]:456/" &&
+ test-tool urlmatch-normalization "xyz://[::1]:/" &&
+ ! test-tool urlmatch-normalization "xyz://[::1]:000/" &&
+ ! test-tool urlmatch-normalization "xyz://[::1]:0%300/" &&
+ ! test-tool urlmatch-normalization "xyz://[::1]:0x80/" &&
+ ! test-tool urlmatch-normalization "xyz://[::1]:4294967297/" &&
+ ! test-tool urlmatch-normalization "xyz://[::1]:030f/"
'
test_expect_success 'url port normalization' '
- test "$(test-urlmatch-normalization -p "http://x:800")" = "http://x:800/" &&
- test "$(test-urlmatch-normalization -p "http://x:0800")" = "http://x:800/" &&
- test "$(test-urlmatch-normalization -p "http://x:00000800")" = "http://x:800/" &&
- test "$(test-urlmatch-normalization -p "http://x:065535")" = "http://x:65535/" &&
- test "$(test-urlmatch-normalization -p "http://x:1")" = "http://x:1/" &&
- test "$(test-urlmatch-normalization -p "http://x:80")" = "http://x/" &&
- test "$(test-urlmatch-normalization -p "http://x:080")" = "http://x/" &&
- test "$(test-urlmatch-normalization -p "http://x:000000080")" = "http://x/" &&
- test "$(test-urlmatch-normalization -p "https://x:443")" = "https://x/" &&
- test "$(test-urlmatch-normalization -p "https://x:0443")" = "https://x/" &&
- test "$(test-urlmatch-normalization -p "https://x:000000443")" = "https://x/"
+ test "$(test-tool urlmatch-normalization -p "http://x:800")" = "http://x:800/" &&
+ test "$(test-tool urlmatch-normalization -p "http://x:0800")" = "http://x:800/" &&
+ test "$(test-tool urlmatch-normalization -p "http://x:00000800")" = "http://x:800/" &&
+ test "$(test-tool urlmatch-normalization -p "http://x:065535")" = "http://x:65535/" &&
+ test "$(test-tool urlmatch-normalization -p "http://x:1")" = "http://x:1/" &&
+ test "$(test-tool urlmatch-normalization -p "http://x:80")" = "http://x/" &&
+ test "$(test-tool urlmatch-normalization -p "http://x:080")" = "http://x/" &&
+ test "$(test-tool urlmatch-normalization -p "http://x:000000080")" = "http://x/" &&
+ test "$(test-tool urlmatch-normalization -p "https://x:443")" = "https://x/" &&
+ test "$(test-tool urlmatch-normalization -p "https://x:0443")" = "https://x/" &&
+ test "$(test-tool urlmatch-normalization -p "https://x:000000443")" = "https://x/"
'
test_expect_success 'url general escapes' '
- ! test-urlmatch-normalization "http://x.y?%fg" &&
- test "$(test-urlmatch-normalization -p "X://W/%7e%41^%3a")" = "x://w/~A%5E%3A" &&
- test "$(test-urlmatch-normalization -p "X://W/:/?#[]@")" = "x://w/:/?#[]@" &&
- test "$(test-urlmatch-normalization -p "X://W/$&()*+,;=")" = "x://w/$&()*+,;=" &&
- test "$(test-urlmatch-normalization -p "X://W/'\''")" = "x://w/'\''" &&
- test "$(test-urlmatch-normalization -p "X://W?'\!'")" = "x://w/?'\!'"
+ ! test-tool urlmatch-normalization "http://x.y?%fg" &&
+ test "$(test-tool urlmatch-normalization -p "X://W/%7e%41^%3a")" = "x://w/~A%5E%3A" &&
+ test "$(test-tool urlmatch-normalization -p "X://W/:/?#[]@")" = "x://w/:/?#[]@" &&
+ test "$(test-tool urlmatch-normalization -p "X://W/$&()*+,;=")" = "x://w/$&()*+,;=" &&
+ test "$(test-tool urlmatch-normalization -p "X://W/'\''")" = "x://w/'\''" &&
+ test "$(test-tool urlmatch-normalization -p "X://W?'\!'")" = "x://w/?'\!'"
'
test_expect_success !MINGW 'url high-bit escapes' '
- test "$(test-urlmatch-normalization -p "$(cat "$tu-1")")" = "x://q/%01%02%03%04%05%06%07%08%0E%0F%10%11%12" &&
- test "$(test-urlmatch-normalization -p "$(cat "$tu-2")")" = "x://q/%13%14%15%16%17%18%19%1B%1C%1D%1E%1F%7F" &&
- test "$(test-urlmatch-normalization -p "$(cat "$tu-3")")" = "x://q/%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F" &&
- test "$(test-urlmatch-normalization -p "$(cat "$tu-4")")" = "x://q/%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F" &&
- test "$(test-urlmatch-normalization -p "$(cat "$tu-5")")" = "x://q/%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF" &&
- test "$(test-urlmatch-normalization -p "$(cat "$tu-6")")" = "x://q/%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF" &&
- test "$(test-urlmatch-normalization -p "$(cat "$tu-7")")" = "x://q/%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF" &&
- test "$(test-urlmatch-normalization -p "$(cat "$tu-8")")" = "x://q/%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF" &&
- test "$(test-urlmatch-normalization -p "$(cat "$tu-9")")" = "x://q/%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF" &&
- test "$(test-urlmatch-normalization -p "$(cat "$tu-10")")" = "x://q/%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF"
+ test "$(test-tool urlmatch-normalization -p "$(cat "$tu-1")")" = "x://q/%01%02%03%04%05%06%07%08%0E%0F%10%11%12" &&
+ test "$(test-tool urlmatch-normalization -p "$(cat "$tu-2")")" = "x://q/%13%14%15%16%17%18%19%1B%1C%1D%1E%1F%7F" &&
+ test "$(test-tool urlmatch-normalization -p "$(cat "$tu-3")")" = "x://q/%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F" &&
+ test "$(test-tool urlmatch-normalization -p "$(cat "$tu-4")")" = "x://q/%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F" &&
+ test "$(test-tool urlmatch-normalization -p "$(cat "$tu-5")")" = "x://q/%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF" &&
+ test "$(test-tool urlmatch-normalization -p "$(cat "$tu-6")")" = "x://q/%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF" &&
+ test "$(test-tool urlmatch-normalization -p "$(cat "$tu-7")")" = "x://q/%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF" &&
+ test "$(test-tool urlmatch-normalization -p "$(cat "$tu-8")")" = "x://q/%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF" &&
+ test "$(test-tool urlmatch-normalization -p "$(cat "$tu-9")")" = "x://q/%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF" &&
+ test "$(test-tool urlmatch-normalization -p "$(cat "$tu-10")")" = "x://q/%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF"
'
test_expect_success 'url utf-8 escapes' '
- test "$(test-urlmatch-normalization -p "$(cat "$tu-11")")" = "x://q/%C2%80%DF%BF%E0%A0%80%EF%BF%BD%F0%90%80%80%F0%AF%BF%BD"
+ test "$(test-tool urlmatch-normalization -p "$(cat "$tu-11")")" = "x://q/%C2%80%DF%BF%E0%A0%80%EF%BF%BD%F0%90%80%80%F0%AF%BF%BD"
'
test_expect_success 'url username/password escapes' '
- test "$(test-urlmatch-normalization -p "x://%41%62(^):%70+d@foo")" = "x://Ab(%5E):p+d@foo/"
+ test "$(test-tool urlmatch-normalization -p "x://%41%62(^):%70+d@foo")" = "x://Ab(%5E):p+d@foo/"
'
test_expect_success 'url normalized lengths' '
- test "$(test-urlmatch-normalization -l "Http://%4d%65:%4d^%70@The.Host")" = 25 &&
- test "$(test-urlmatch-normalization -l "http://%41:%42@x.y/%61/")" = 17 &&
- test "$(test-urlmatch-normalization -l "http://@x.y/^")" = 15
+ test "$(test-tool urlmatch-normalization -l "Http://%4d%65:%4d^%70@The.Host")" = 25 &&
+ test "$(test-tool urlmatch-normalization -l "http://%41:%42@x.y/%61/")" = 17 &&
+ test "$(test-tool urlmatch-normalization -l "http://@x.y/^")" = 15
'
test_expect_success 'url . and .. segments' '
- test "$(test-urlmatch-normalization -p "x://y/.")" = "x://y/" &&
- test "$(test-urlmatch-normalization -p "x://y/./")" = "x://y/" &&
- test "$(test-urlmatch-normalization -p "x://y/a/.")" = "x://y/a" &&
- test "$(test-urlmatch-normalization -p "x://y/a/./")" = "x://y/a/" &&
- test "$(test-urlmatch-normalization -p "x://y/.?")" = "x://y/?" &&
- test "$(test-urlmatch-normalization -p "x://y/./?")" = "x://y/?" &&
- test "$(test-urlmatch-normalization -p "x://y/a/.?")" = "x://y/a?" &&
- test "$(test-urlmatch-normalization -p "x://y/a/./?")" = "x://y/a/?" &&
- test "$(test-urlmatch-normalization -p "x://y/a/./b/.././../c")" = "x://y/c" &&
- test "$(test-urlmatch-normalization -p "x://y/a/./b/../.././c/")" = "x://y/c/" &&
- test "$(test-urlmatch-normalization -p "x://y/a/./b/.././../c/././.././.")" = "x://y/" &&
- ! test-urlmatch-normalization "x://y/a/./b/.././../c/././.././.." &&
- test "$(test-urlmatch-normalization -p "x://y/a/./?/././..")" = "x://y/a/?/././.." &&
- test "$(test-urlmatch-normalization -p "x://y/%2e/")" = "x://y/" &&
- test "$(test-urlmatch-normalization -p "x://y/%2E/")" = "x://y/" &&
- test "$(test-urlmatch-normalization -p "x://y/a/%2e./")" = "x://y/" &&
- test "$(test-urlmatch-normalization -p "x://y/b/.%2E/")" = "x://y/" &&
- test "$(test-urlmatch-normalization -p "x://y/c/%2e%2E/")" = "x://y/"
+ test "$(test-tool urlmatch-normalization -p "x://y/.")" = "x://y/" &&
+ test "$(test-tool urlmatch-normalization -p "x://y/./")" = "x://y/" &&
+ test "$(test-tool urlmatch-normalization -p "x://y/a/.")" = "x://y/a" &&
+ test "$(test-tool urlmatch-normalization -p "x://y/a/./")" = "x://y/a/" &&
+ test "$(test-tool urlmatch-normalization -p "x://y/.?")" = "x://y/?" &&
+ test "$(test-tool urlmatch-normalization -p "x://y/./?")" = "x://y/?" &&
+ test "$(test-tool urlmatch-normalization -p "x://y/a/.?")" = "x://y/a?" &&
+ test "$(test-tool urlmatch-normalization -p "x://y/a/./?")" = "x://y/a/?" &&
+ test "$(test-tool urlmatch-normalization -p "x://y/a/./b/.././../c")" = "x://y/c" &&
+ test "$(test-tool urlmatch-normalization -p "x://y/a/./b/../.././c/")" = "x://y/c/" &&
+ test "$(test-tool urlmatch-normalization -p "x://y/a/./b/.././../c/././.././.")" = "x://y/" &&
+ ! test-tool urlmatch-normalization "x://y/a/./b/.././../c/././.././.." &&
+ test "$(test-tool urlmatch-normalization -p "x://y/a/./?/././..")" = "x://y/a/?/././.." &&
+ test "$(test-tool urlmatch-normalization -p "x://y/%2e/")" = "x://y/" &&
+ test "$(test-tool urlmatch-normalization -p "x://y/%2E/")" = "x://y/" &&
+ test "$(test-tool urlmatch-normalization -p "x://y/a/%2e./")" = "x://y/" &&
+ test "$(test-tool urlmatch-normalization -p "x://y/b/.%2E/")" = "x://y/" &&
+ test "$(test-tool urlmatch-normalization -p "x://y/c/%2e%2E/")" = "x://y/"
'
# http://@foo specifies an empty user name but does not specify a password
# http://foo specifies neither a user name nor a password
# So they should not be equivalent
test_expect_success 'url equivalents' '
- test-urlmatch-normalization "httP://x" "Http://X/" &&
- test-urlmatch-normalization "Http://%4d%65:%4d^%70@The.Host" "hTTP://Me:%4D^p@the.HOST:80/" &&
- ! test-urlmatch-normalization "https://@x.y/^" "httpS://x.y:443/^" &&
- test-urlmatch-normalization "https://@x.y/^" "httpS://@x.y:0443/^" &&
- test-urlmatch-normalization "https://@x.y/^/../abc" "httpS://@x.y:0443/abc" &&
- test-urlmatch-normalization "https://@x.y/^/.." "httpS://@x.y:0443/"
+ test-tool urlmatch-normalization "httP://x" "Http://X/" &&
+ test-tool urlmatch-normalization "Http://%4d%65:%4d^%70@The.Host" "hTTP://Me:%4D^p@the.HOST:80/" &&
+ ! test-tool urlmatch-normalization "https://@x.y/^" "httpS://x.y:443/^" &&
+ test-tool urlmatch-normalization "https://@x.y/^" "httpS://@x.y:0443/^" &&
+ test-tool urlmatch-normalization "https://@x.y/^/../abc" "httpS://@x.y:0443/abc" &&
+ test-tool urlmatch-normalization "https://@x.y/^/.." "httpS://@x.y:0443/"
'
test_done
--
2.16.2.903.gd04caf5039
next prev parent reply other threads:[~2018-03-17 7:56 UTC|newest]
Thread overview: 110+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-17 7:53 [PATCH 00/36] Combine t/helper binaries into a single one Nguyễn Thái Ngọc Duy
2018-03-17 7:53 ` [PATCH 01/36] t/helper: add an empty test-tool program Nguyễn Thái Ngọc Duy
2018-03-17 7:53 ` [PATCH 02/36] t/helper: merge test-chmtime into test-tool Nguyễn Thái Ngọc Duy
2018-03-17 7:53 ` [PATCH 03/36] t/helper: merge test-sha1 " Nguyễn Thái Ngọc Duy
2018-03-17 7:53 ` [PATCH 04/36] t/helper: merge test-lazy-init-name-hash " Nguyễn Thái Ngọc Duy
2018-03-18 2:11 ` Eric Sunshine
2018-03-18 8:25 ` Duy Nguyen
2018-03-18 8:47 ` Eric Sunshine
2018-03-19 9:40 ` Jeff Hostetler
2018-03-19 15:51 ` Duy Nguyen
2018-03-17 7:53 ` [PATCH 05/36] t/helper: merge test-config " Nguyễn Thái Ngọc Duy
2018-03-17 7:53 ` [PATCH 06/36] t/helper: merge test-ctype " Nguyễn Thái Ngọc Duy
2018-03-17 7:53 ` [PATCH 07/36] t/helper: merge test-date " Nguyễn Thái Ngọc Duy
2018-03-17 7:53 ` [PATCH 08/36] t/helper: merge (unused) test-delta " Nguyễn Thái Ngọc Duy
2018-03-17 7:53 ` [PATCH 09/36] t/helper: merge test-drop-caches " Nguyễn Thái Ngọc Duy
2018-03-17 7:53 ` [PATCH 10/36] t/helper: merge test-dump-cache-tree " Nguyễn Thái Ngọc Duy
2018-03-17 7:53 ` [PATCH 11/36] t/helper: merge test-dump-split-index " Nguyễn Thái Ngọc Duy
2018-03-17 7:53 ` [PATCH 12/36] t/helper: merge test-example-decorate " Nguyễn Thái Ngọc Duy
2018-03-17 7:53 ` [PATCH 13/36] t/helper: merge test-genrandom " Nguyễn Thái Ngọc Duy
2018-03-17 7:53 ` [PATCH 14/36] t/helper: merge test-hashmap " Nguyễn Thái Ngọc Duy
2018-03-17 7:54 ` [PATCH 15/36] t/helper: merge test-index-version " Nguyễn Thái Ngọc Duy
2018-03-17 7:54 ` [PATCH 16/36] t/helper: merge (unused) test-match-trees " Nguyễn Thái Ngọc Duy
2018-03-17 7:54 ` [PATCH 17/36] t/helper: merge (unused) test-mergesort " Nguyễn Thái Ngọc Duy
2018-03-17 7:54 ` [PATCH 18/36] t/helper: merge test-mktemp " Nguyễn Thái Ngọc Duy
2018-03-17 7:54 ` [PATCH 19/36] t/helper: merge test-online-cpus " Nguyễn Thái Ngọc Duy
2018-03-17 7:54 ` [PATCH 20/36] t/helper: merge test-path-utils " Nguyễn Thái Ngọc Duy
2018-03-17 7:54 ` [PATCH 21/36] t/helper: merge test-prio-queue " Nguyễn Thái Ngọc Duy
2018-03-17 7:54 ` [PATCH 22/36] t/helepr: merge test-read-cache " Nguyễn Thái Ngọc Duy
2018-03-18 2:21 ` Eric Sunshine
2018-03-17 7:54 ` [PATCH 23/36] t/helper: merge test-ref-store " Nguyễn Thái Ngọc Duy
2018-03-17 7:54 ` [PATCH 24/36] t/helper: merge test-regex " Nguyễn Thái Ngọc Duy
2018-03-17 7:54 ` [PATCH 25/36] t/helper: merge test-revision-walking " Nguyễn Thái Ngọc Duy
2018-03-17 7:54 ` [PATCH 26/36] t/helper: merge test-run-command " Nguyễn Thái Ngọc Duy
2018-03-17 7:54 ` [PATCH 27/36] t/helper: merge test-scrap-cache-tree " Nguyễn Thái Ngọc Duy
2018-03-17 7:54 ` [PATCH 28/36] t/helper: merge test-sha1-array " Nguyễn Thái Ngọc Duy
2018-03-17 7:54 ` [PATCH 29/36] t/helper: merge test-sigchain " Nguyễn Thái Ngọc Duy
2018-03-17 7:54 ` [PATCH 30/36] t/helper: merge test-strcmp-offset " Nguyễn Thái Ngọc Duy
2018-03-17 7:54 ` [PATCH 31/36] t/helper: merge test-string-list " Nguyễn Thái Ngọc Duy
2018-03-17 7:54 ` [PATCH 32/36] t/helper: merge test-submodule-config " Nguyễn Thái Ngọc Duy
2018-03-17 7:54 ` [PATCH 33/36] t/helper: merge test-subprocess " Nguyễn Thái Ngọc Duy
2018-03-17 7:54 ` Nguyễn Thái Ngọc Duy [this message]
2018-03-18 2:32 ` [PATCH 34/36] t/helper: merge test-urlmatch-.. " Eric Sunshine
2018-03-17 7:54 ` [PATCH 35/36] t/helper: merge test-wildmatch " Nguyễn Thái Ngọc Duy
2018-03-17 7:54 ` [PATCH 36/36] t/helper: merge test-write-cache " Nguyễn Thái Ngọc Duy
2018-03-24 7:42 ` [PATCH v2 00/36] Combine t/helper binaries into a single one Nguyễn Thái Ngọc Duy
2018-03-24 7:42 ` [PATCH v4 1/7] t7700: have closing quote of a test at the beginning of line Nguyễn Thái Ngọc Duy
2018-03-24 7:42 ` [PATCH v2 01/36] t/helper: add an empty test-tool program Nguyễn Thái Ngọc Duy
2018-03-24 7:42 ` [PATCH v4 2/7] repack: add --keep-pack option Nguyễn Thái Ngọc Duy
2018-03-24 7:42 ` [PATCH v2 02/36] t/helper: merge test-chmtime into test-tool Nguyễn Thái Ngọc Duy
2018-03-24 7:42 ` [PATCH v4 3/7] gc: add --keep-largest-pack option Nguyễn Thái Ngọc Duy
2018-03-24 9:36 ` Ævar Arnfjörð Bjarmason
2018-03-24 12:13 ` Duy Nguyen
2018-03-26 2:05 ` Junio C Hamano
2018-03-24 7:42 ` [PATCH v2 03/36] t/helper: merge test-sha1 into test-tool Nguyễn Thái Ngọc Duy
2018-03-24 7:42 ` [PATCH v4 4/7] gc: add gc.bigPackThreshold config Nguyễn Thái Ngọc Duy
2018-03-24 7:42 ` [PATCH v2 04/36] t/helper: merge test-lazy-init-name-hash into test-tool Nguyễn Thái Ngọc Duy
2018-03-24 7:42 ` [PATCH v4 5/7] gc: handle a corner case in gc.bigPackThreshold Nguyễn Thái Ngọc Duy
2018-03-24 7:42 ` [PATCH v2 05/36] t/helper: merge test-config into test-tool Nguyễn Thái Ngọc Duy
2018-03-24 7:42 ` [PATCH v4 6/7] gc --auto: exclude base pack if not enough mem to "repack -ad" Nguyễn Thái Ngọc Duy
2018-03-24 7:42 ` [PATCH v2 06/36] t/helper: merge test-ctype into test-tool Nguyễn Thái Ngọc Duy
2018-03-24 7:42 ` [PATCH v4 7/7] pack-objects: show some progress when counting kept objects Nguyễn Thái Ngọc Duy
2018-03-24 7:42 ` [PATCH v2 07/36] t/helper: merge test-date into test-tool Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 00/36] Combine t/helper binaries into a single one Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 01/36] t/helper: add an empty test-tool program Nguyễn Thái Ngọc Duy
2018-03-26 15:27 ` Johannes Schindelin
2018-03-26 17:09 ` Duy Nguyen
2018-03-26 22:14 ` Johannes Schindelin
2018-03-26 23:07 ` SZEDER Gábor
2018-03-27 13:57 ` Johannes Schindelin
2018-03-24 7:44 ` [PATCH v2 02/36] t/helper: merge test-chmtime into test-tool Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 03/36] t/helper: merge test-sha1 " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 04/36] t/helper: merge test-lazy-init-name-hash " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 05/36] t/helper: merge test-config " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 06/36] t/helper: merge test-ctype " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 07/36] t/helper: merge test-date " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 08/36] t/helper: merge (unused) test-delta " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 09/36] t/helper: merge test-drop-caches " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 10/36] t/helper: merge test-dump-cache-tree " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 11/36] t/helper: merge test-dump-split-index " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 12/36] t/helper: merge test-example-decorate " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 13/36] t/helper: merge test-genrandom " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 14/36] t/helper: merge test-hashmap " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 15/36] t/helper: merge test-index-version " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 16/36] t/helper: merge (unused) test-match-trees " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 17/36] t/helper: merge (unused) test-mergesort " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 18/36] t/helper: merge test-mktemp " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 19/36] t/helper: merge test-online-cpus " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 20/36] t/helper: merge test-path-utils " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 21/36] t/helper: merge test-prio-queue " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 22/36] t/helper: merge test-read-cache " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 23/36] t/helper: merge test-ref-store " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 24/36] t/helper: merge test-regex " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 25/36] t/helper: merge test-revision-walking " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 26/36] t/helper: merge test-run-command " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 27/36] t/helper: merge test-scrap-cache-tree " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 28/36] t/helper: merge test-sha1-array " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 29/36] t/helper: merge test-sigchain " Nguyễn Thái Ngọc Duy
2018-03-24 7:44 ` [PATCH v2 30/36] t/helper: merge test-strcmp-offset " Nguyễn Thái Ngọc Duy
2018-03-24 7:45 ` [PATCH v2 31/36] t/helper: merge test-string-list " Nguyễn Thái Ngọc Duy
2018-03-24 7:45 ` [PATCH v2 32/36] t/helper: merge test-submodule-config " Nguyễn Thái Ngọc Duy
2018-03-24 7:45 ` [PATCH v2 33/36] t/helper: merge test-subprocess " Nguyễn Thái Ngọc Duy
2018-03-24 7:45 ` [PATCH v2 34/36] t/helper: merge test-urlmatch-normalization " Nguyễn Thái Ngọc Duy
2018-03-24 7:45 ` [PATCH v2 35/36] t/helper: merge test-wildmatch " Nguyễn Thái Ngọc Duy
2018-03-24 7:45 ` [PATCH v2 36/36] t/helper: merge test-write-cache " Nguyễn Thái Ngọc Duy
2018-03-24 12:50 ` [PATCH v2 00/36] Combine t/helper binaries into a single one Ævar Arnfjörð Bjarmason
2018-03-24 12:57 ` Duy Nguyen
2018-03-26 2:16 ` Junio C Hamano
2018-03-27 14:00 ` Johannes Schindelin
2018-03-27 15:42 ` Junio C Hamano
2018-03-27 16:12 ` Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180317075421.22032-35-pclouds@gmail.com \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).