t/helper: merge test-urlmatch-normalization into test-tool
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
Mar 24, 2018 at 08:45 UTC
599fbd873396ece0f1b1c2ef393d4eca5ef1bf26
5 files changed
+139
-136
Makefile
+1
-1
@@ -684,6 +684,7 @@ TEST_BUILTINS_OBJS += test-strcmp-offset.o
684
TEST_BUILTINS_OBJS += test-string-list.o
685
TEST_BUILTINS_OBJS += test-submodule-config.o
686
TEST_BUILTINS_OBJS += test-subprocess.o
687
+TEST_BUILTINS_OBJS += test-urlmatch-normalization.o
688
689
TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
690
TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
@@ -693,7 +694,6 @@ TEST_PROGRAMS_NEED_X += test-parse-options
694
TEST_PROGRAMS_NEED_X += test-write-cache
695
TEST_PROGRAMS_NEED_X += test-svn-fe
696
TEST_PROGRAMS_NEED_X += test-tool
696
-TEST_PROGRAMS_NEED_X += test-urlmatch-normalization
697
TEST_PROGRAMS_NEED_X += test-wildmatch
698
699
TEST_PROGRAMS = $(patsubst %,t/helper/%$X,$(TEST_PROGRAMS_NEED_X))
t/helper/test-tool.c
+1
@@ -39,6 +39,7 @@ static struct test_cmd cmds[] = {
39
{ "string-list", cmd__string_list },
40
{ "submodule-config", cmd__submodule_config },
41
{ "subprocess", cmd__subprocess },
42
+ { "urlmatch-normalization", cmd__urlmatch_normalization },
43
};
44
45
int cmd_main(int argc, const char **argv)
t/helper/test-tool.h
+1
@@ -33,5 +33,6 @@ int cmd__strcmp_offset(int argc, const char **argv);
33
int cmd__string_list(int argc, const char **argv);
34
int cmd__submodule_config(int argc, const char **argv);
35
int cmd__subprocess(int argc, const char **argv);
36
+int cmd__urlmatch_normalization(int argc, const char **argv);
37
38
#endif
t/helper/test-urlmatch-normalization.c
+3
-2
@@ -1,9 +1,10 @@
1
+#include "test-tool.h"
2
#include "git-compat-util.h"
3
#include "urlmatch.h"
4
4
-int cmd_main(int argc, const char **argv)
5
+int cmd__urlmatch_normalization(int argc, const char **argv)
6
{
6
- const char usage[] = "test-urlmatch-normalization [-p | -l] <url1> | <url1> <url2>";
7
+ const char usage[] = "test-tool urlmatch-normalization [-p | -l] <url1> | <url1> <url2>";
8
char *url1, *url2;
9
int opt_p = 0, opt_l = 0;
10
t/t0110-urlmatch-normalization.sh
+133
-133
@@ -9,172 +9,172 @@ tu="$TEST_DIRECTORY/t0110/url"
9
# Note that only file: URLs should be allowed without a host
10
11
test_expect_success 'url scheme' '
12
- ! test-urlmatch-normalization "" &&
13
- ! test-urlmatch-normalization "_" &&
14
- ! test-urlmatch-normalization "scheme" &&
15
- ! test-urlmatch-normalization "scheme:" &&
16
- ! test-urlmatch-normalization "scheme:/" &&
17
- ! test-urlmatch-normalization "scheme://" &&
18
- ! test-urlmatch-normalization "file" &&
19
- ! test-urlmatch-normalization "file:" &&
20
- ! test-urlmatch-normalization "file:/" &&
21
- test-urlmatch-normalization "file://" &&
22
- ! test-urlmatch-normalization "://acme.co" &&
23
- ! test-urlmatch-normalization "x_test://acme.co" &&
24
- ! test-urlmatch-normalization "-test://acme.co" &&
25
- ! test-urlmatch-normalization "0test://acme.co" &&
26
- ! test-urlmatch-normalization "+test://acme.co" &&
27
- ! test-urlmatch-normalization ".test://acme.co" &&
28
- ! test-urlmatch-normalization "schem%6e://" &&
29
- test-urlmatch-normalization "x-Test+v1.0://acme.co" &&
30
- test "$(test-urlmatch-normalization -p "AbCdeF://x.Y")" = "abcdef://x.y/"
12
+ ! test-tool urlmatch-normalization "" &&
13
+ ! test-tool urlmatch-normalization "_" &&
14
+ ! test-tool urlmatch-normalization "scheme" &&
15
+ ! test-tool urlmatch-normalization "scheme:" &&
16
+ ! test-tool urlmatch-normalization "scheme:/" &&
17
+ ! test-tool urlmatch-normalization "scheme://" &&
18
+ ! test-tool urlmatch-normalization "file" &&
19
+ ! test-tool urlmatch-normalization "file:" &&
20
+ ! test-tool urlmatch-normalization "file:/" &&
21
+ test-tool urlmatch-normalization "file://" &&
22
+ ! test-tool urlmatch-normalization "://acme.co" &&
23
+ ! test-tool urlmatch-normalization "x_test://acme.co" &&
24
+ ! test-tool urlmatch-normalization "-test://acme.co" &&
25
+ ! test-tool urlmatch-normalization "0test://acme.co" &&
26
+ ! test-tool urlmatch-normalization "+test://acme.co" &&
27
+ ! test-tool urlmatch-normalization ".test://acme.co" &&
28
+ ! test-tool urlmatch-normalization "schem%6e://" &&
29
+ test-tool urlmatch-normalization "x-Test+v1.0://acme.co" &&
30
+ test "$(test-tool urlmatch-normalization -p "AbCdeF://x.Y")" = "abcdef://x.y/"
31
'
32
33
test_expect_success 'url authority' '
34
- ! test-urlmatch-normalization "scheme://user:pass@" &&
35
- ! test-urlmatch-normalization "scheme://?" &&
36
- ! test-urlmatch-normalization "scheme://#" &&
37
- ! test-urlmatch-normalization "scheme:///" &&
38
- ! test-urlmatch-normalization "scheme://:" &&
39
- ! test-urlmatch-normalization "scheme://:555" &&
40
- test-urlmatch-normalization "file://user:pass@" &&
41
- test-urlmatch-normalization "file://?" &&
42
- test-urlmatch-normalization "file://#" &&
43
- test-urlmatch-normalization "file:///" &&
44
- test-urlmatch-normalization "file://:" &&
45
- ! test-urlmatch-normalization "file://:555" &&
46
- test-urlmatch-normalization "scheme://user:pass@host" &&
47
- test-urlmatch-normalization "scheme://@host" &&
48
- test-urlmatch-normalization "scheme://%00@host" &&
49
- ! test-urlmatch-normalization "scheme://%%@host" &&
50
- ! test-urlmatch-normalization "scheme://host_" &&
51
- test-urlmatch-normalization "scheme://user:pass@host/" &&
52
- test-urlmatch-normalization "scheme://@host/" &&
53
- test-urlmatch-normalization "scheme://host/" &&
54
- test-urlmatch-normalization "scheme://host?x" &&
55
- test-urlmatch-normalization "scheme://host#x" &&
56
- test-urlmatch-normalization "scheme://host/@" &&
57
- test-urlmatch-normalization "scheme://host?@x" &&
58
- test-urlmatch-normalization "scheme://host#@x" &&
59
- test-urlmatch-normalization "scheme://[::1]" &&
60
- test-urlmatch-normalization "scheme://[::1]/" &&
61
- ! test-urlmatch-normalization "scheme://hos%41/" &&
62
- test-urlmatch-normalization "scheme://[invalid....:/" &&
63
- test-urlmatch-normalization "scheme://invalid....:]/" &&
64
- ! test-urlmatch-normalization "scheme://invalid....:[/" &&
65
- ! test-urlmatch-normalization "scheme://invalid....:["
34
+ ! test-tool urlmatch-normalization "scheme://user:pass@" &&
35
+ ! test-tool urlmatch-normalization "scheme://?" &&
36
+ ! test-tool urlmatch-normalization "scheme://#" &&
37
+ ! test-tool urlmatch-normalization "scheme:///" &&
38
+ ! test-tool urlmatch-normalization "scheme://:" &&
39
+ ! test-tool urlmatch-normalization "scheme://:555" &&
40
+ test-tool urlmatch-normalization "file://user:pass@" &&
41
+ test-tool urlmatch-normalization "file://?" &&
42
+ test-tool urlmatch-normalization "file://#" &&
43
+ test-tool urlmatch-normalization "file:///" &&
44
+ test-tool urlmatch-normalization "file://:" &&
45
+ ! test-tool urlmatch-normalization "file://:555" &&
46
+ test-tool urlmatch-normalization "scheme://user:pass@host" &&
47
+ test-tool urlmatch-normalization "scheme://@host" &&
48
+ test-tool urlmatch-normalization "scheme://%00@host" &&
49
+ ! test-tool urlmatch-normalization "scheme://%%@host" &&
50
+ ! test-tool urlmatch-normalization "scheme://host_" &&
51
+ test-tool urlmatch-normalization "scheme://user:pass@host/" &&
52
+ test-tool urlmatch-normalization "scheme://@host/" &&
53
+ test-tool urlmatch-normalization "scheme://host/" &&
54
+ test-tool urlmatch-normalization "scheme://host?x" &&
55
+ test-tool urlmatch-normalization "scheme://host#x" &&
56
+ test-tool urlmatch-normalization "scheme://host/@" &&
57
+ test-tool urlmatch-normalization "scheme://host?@x" &&
58
+ test-tool urlmatch-normalization "scheme://host#@x" &&
59
+ test-tool urlmatch-normalization "scheme://[::1]" &&
60
+ test-tool urlmatch-normalization "scheme://[::1]/" &&
61
+ ! test-tool urlmatch-normalization "scheme://hos%41/" &&
62
+ test-tool urlmatch-normalization "scheme://[invalid....:/" &&
63
+ test-tool urlmatch-normalization "scheme://invalid....:]/" &&
64
+ ! test-tool urlmatch-normalization "scheme://invalid....:[/" &&
65
+ ! test-tool urlmatch-normalization "scheme://invalid....:["
66
'
67
68
test_expect_success 'url port checks' '
69
- test-urlmatch-normalization "xyz://q@some.host:" &&
70
- test-urlmatch-normalization "xyz://q@some.host:456/" &&
71
- ! test-urlmatch-normalization "xyz://q@some.host:0" &&
72
- ! test-urlmatch-normalization "xyz://q@some.host:0000000" &&
73
- test-urlmatch-normalization "xyz://q@some.host:0000001?" &&
74
- test-urlmatch-normalization "xyz://q@some.host:065535#" &&
75
- test-urlmatch-normalization "xyz://q@some.host:65535" &&
76
- ! test-urlmatch-normalization "xyz://q@some.host:65536" &&
77
- ! test-urlmatch-normalization "xyz://q@some.host:99999" &&
78
- ! test-urlmatch-normalization "xyz://q@some.host:100000" &&
79
- ! test-urlmatch-normalization "xyz://q@some.host:100001" &&
80
- test-urlmatch-normalization "http://q@some.host:80" &&
81
- test-urlmatch-normalization "https://q@some.host:443" &&
82
- test-urlmatch-normalization "http://q@some.host:80/" &&
83
- test-urlmatch-normalization "https://q@some.host:443?" &&
84
- ! test-urlmatch-normalization "http://q@:8008" &&
85
- ! test-urlmatch-normalization "http://:8080" &&
86
- ! test-urlmatch-normalization "http://:" &&
87
- test-urlmatch-normalization "xyz://q@some.host:456/" &&
88
- test-urlmatch-normalization "xyz://[::1]:456/" &&
89
- test-urlmatch-normalization "xyz://[::1]:/" &&
90
- ! test-urlmatch-normalization "xyz://[::1]:000/" &&
91
- ! test-urlmatch-normalization "xyz://[::1]:0%300/" &&
92
- ! test-urlmatch-normalization "xyz://[::1]:0x80/" &&
93
- ! test-urlmatch-normalization "xyz://[::1]:4294967297/" &&
94
- ! test-urlmatch-normalization "xyz://[::1]:030f/"
69
+ test-tool urlmatch-normalization "xyz://q@some.host:" &&
70
+ test-tool urlmatch-normalization "xyz://q@some.host:456/" &&
71
+ ! test-tool urlmatch-normalization "xyz://q@some.host:0" &&
72
+ ! test-tool urlmatch-normalization "xyz://q@some.host:0000000" &&
73
+ test-tool urlmatch-normalization "xyz://q@some.host:0000001?" &&
74
+ test-tool urlmatch-normalization "xyz://q@some.host:065535#" &&
75
+ test-tool urlmatch-normalization "xyz://q@some.host:65535" &&
76
+ ! test-tool urlmatch-normalization "xyz://q@some.host:65536" &&
77
+ ! test-tool urlmatch-normalization "xyz://q@some.host:99999" &&
78
+ ! test-tool urlmatch-normalization "xyz://q@some.host:100000" &&
79
+ ! test-tool urlmatch-normalization "xyz://q@some.host:100001" &&
80
+ test-tool urlmatch-normalization "http://q@some.host:80" &&
81
+ test-tool urlmatch-normalization "https://q@some.host:443" &&
82
+ test-tool urlmatch-normalization "http://q@some.host:80/" &&
83
+ test-tool urlmatch-normalization "https://q@some.host:443?" &&
84
+ ! test-tool urlmatch-normalization "http://q@:8008" &&
85
+ ! test-tool urlmatch-normalization "http://:8080" &&
86
+ ! test-tool urlmatch-normalization "http://:" &&
87
+ test-tool urlmatch-normalization "xyz://q@some.host:456/" &&
88
+ test-tool urlmatch-normalization "xyz://[::1]:456/" &&
89
+ test-tool urlmatch-normalization "xyz://[::1]:/" &&
90
+ ! test-tool urlmatch-normalization "xyz://[::1]:000/" &&
91
+ ! test-tool urlmatch-normalization "xyz://[::1]:0%300/" &&
92
+ ! test-tool urlmatch-normalization "xyz://[::1]:0x80/" &&
93
+ ! test-tool urlmatch-normalization "xyz://[::1]:4294967297/" &&
94
+ ! test-tool urlmatch-normalization "xyz://[::1]:030f/"
95
'
96
97
test_expect_success 'url port normalization' '
98
- test "$(test-urlmatch-normalization -p "http://x:800")" = "http://x:800/" &&
99
- test "$(test-urlmatch-normalization -p "http://x:0800")" = "http://x:800/" &&
100
- test "$(test-urlmatch-normalization -p "http://x:00000800")" = "http://x:800/" &&
101
- test "$(test-urlmatch-normalization -p "http://x:065535")" = "http://x:65535/" &&
102
- test "$(test-urlmatch-normalization -p "http://x:1")" = "http://x:1/" &&
103
- test "$(test-urlmatch-normalization -p "http://x:80")" = "http://x/" &&
104
- test "$(test-urlmatch-normalization -p "http://x:080")" = "http://x/" &&
105
- test "$(test-urlmatch-normalization -p "http://x:000000080")" = "http://x/" &&
106
- test "$(test-urlmatch-normalization -p "https://x:443")" = "https://x/" &&
107
- test "$(test-urlmatch-normalization -p "https://x:0443")" = "https://x/" &&
108
- test "$(test-urlmatch-normalization -p "https://x:000000443")" = "https://x/"
98
+ test "$(test-tool urlmatch-normalization -p "http://x:800")" = "http://x:800/" &&
99
+ test "$(test-tool urlmatch-normalization -p "http://x:0800")" = "http://x:800/" &&
100
+ test "$(test-tool urlmatch-normalization -p "http://x:00000800")" = "http://x:800/" &&
101
+ test "$(test-tool urlmatch-normalization -p "http://x:065535")" = "http://x:65535/" &&
102
+ test "$(test-tool urlmatch-normalization -p "http://x:1")" = "http://x:1/" &&
103
+ test "$(test-tool urlmatch-normalization -p "http://x:80")" = "http://x/" &&
104
+ test "$(test-tool urlmatch-normalization -p "http://x:080")" = "http://x/" &&
105
+ test "$(test-tool urlmatch-normalization -p "http://x:000000080")" = "http://x/" &&
106
+ test "$(test-tool urlmatch-normalization -p "https://x:443")" = "https://x/" &&
107
+ test "$(test-tool urlmatch-normalization -p "https://x:0443")" = "https://x/" &&
108
+ test "$(test-tool urlmatch-normalization -p "https://x:000000443")" = "https://x/"
109
'
110
111
test_expect_success 'url general escapes' '
112
- ! test-urlmatch-normalization "http://x.y?%fg" &&
113
- test "$(test-urlmatch-normalization -p "X://W/%7e%41^%3a")" = "x://w/~A%5E%3A" &&
114
- test "$(test-urlmatch-normalization -p "X://W/:/?#[]@")" = "x://w/:/?#[]@" &&
115
- test "$(test-urlmatch-normalization -p "X://W/$&()*+,;=")" = "x://w/$&()*+,;=" &&
116
- test "$(test-urlmatch-normalization -p "X://W/'\''")" = "x://w/'\''" &&
117
- test "$(test-urlmatch-normalization -p "X://W?'\!'")" = "x://w/?'\!'"
112
+ ! test-tool urlmatch-normalization "http://x.y?%fg" &&
113
+ test "$(test-tool urlmatch-normalization -p "X://W/%7e%41^%3a")" = "x://w/~A%5E%3A" &&
114
+ test "$(test-tool urlmatch-normalization -p "X://W/:/?#[]@")" = "x://w/:/?#[]@" &&
115
+ test "$(test-tool urlmatch-normalization -p "X://W/$&()*+,;=")" = "x://w/$&()*+,;=" &&
116
+ test "$(test-tool urlmatch-normalization -p "X://W/'\''")" = "x://w/'\''" &&
117
+ test "$(test-tool urlmatch-normalization -p "X://W?'\!'")" = "x://w/?'\!'"
118
'
119
120
test_expect_success !MINGW 'url high-bit escapes' '
121
- test "$(test-urlmatch-normalization -p "$(cat "$tu-1")")" = "x://q/%01%02%03%04%05%06%07%08%0E%0F%10%11%12" &&
122
- test "$(test-urlmatch-normalization -p "$(cat "$tu-2")")" = "x://q/%13%14%15%16%17%18%19%1B%1C%1D%1E%1F%7F" &&
123
- 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" &&
124
- 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" &&
125
- 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" &&
126
- 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" &&
127
- 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" &&
128
- 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" &&
129
- 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" &&
130
- 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"
121
+ test "$(test-tool urlmatch-normalization -p "$(cat "$tu-1")")" = "x://q/%01%02%03%04%05%06%07%08%0E%0F%10%11%12" &&
122
+ test "$(test-tool urlmatch-normalization -p "$(cat "$tu-2")")" = "x://q/%13%14%15%16%17%18%19%1B%1C%1D%1E%1F%7F" &&
123
+ 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" &&
124
+ 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" &&
125
+ 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" &&
126
+ 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" &&
127
+ 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" &&
128
+ 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" &&
129
+ 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" &&
130
+ 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"
131
'
132
133
test_expect_success 'url utf-8 escapes' '
134
- 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"
134
+ 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"
135
'
136
137
test_expect_success 'url username/password escapes' '
138
- test "$(test-urlmatch-normalization -p "x://%41%62(^):%70+d@foo")" = "x://Ab(%5E):p+d@foo/"
138
+ test "$(test-tool urlmatch-normalization -p "x://%41%62(^):%70+d@foo")" = "x://Ab(%5E):p+d@foo/"
139
'
140
141
test_expect_success 'url normalized lengths' '
142
- test "$(test-urlmatch-normalization -l "Http://%4d%65:%4d^%70@The.Host")" = 25 &&
143
- test "$(test-urlmatch-normalization -l "http://%41:%42@x.y/%61/")" = 17 &&
144
- test "$(test-urlmatch-normalization -l "http://@x.y/^")" = 15
142
+ test "$(test-tool urlmatch-normalization -l "Http://%4d%65:%4d^%70@The.Host")" = 25 &&
143
+ test "$(test-tool urlmatch-normalization -l "http://%41:%42@x.y/%61/")" = 17 &&
144
+ test "$(test-tool urlmatch-normalization -l "http://@x.y/^")" = 15
145
'
146
147
test_expect_success 'url . and .. segments' '
148
- test "$(test-urlmatch-normalization -p "x://y/.")" = "x://y/" &&
149
- test "$(test-urlmatch-normalization -p "x://y/./")" = "x://y/" &&
150
- test "$(test-urlmatch-normalization -p "x://y/a/.")" = "x://y/a" &&
151
- test "$(test-urlmatch-normalization -p "x://y/a/./")" = "x://y/a/" &&
152
- test "$(test-urlmatch-normalization -p "x://y/.?")" = "x://y/?" &&
153
- test "$(test-urlmatch-normalization -p "x://y/./?")" = "x://y/?" &&
154
- test "$(test-urlmatch-normalization -p "x://y/a/.?")" = "x://y/a?" &&
155
- test "$(test-urlmatch-normalization -p "x://y/a/./?")" = "x://y/a/?" &&
156
- test "$(test-urlmatch-normalization -p "x://y/a/./b/.././../c")" = "x://y/c" &&
157
- test "$(test-urlmatch-normalization -p "x://y/a/./b/../.././c/")" = "x://y/c/" &&
158
- test "$(test-urlmatch-normalization -p "x://y/a/./b/.././../c/././.././.")" = "x://y/" &&
159
- ! test-urlmatch-normalization "x://y/a/./b/.././../c/././.././.." &&
160
- test "$(test-urlmatch-normalization -p "x://y/a/./?/././..")" = "x://y/a/?/././.." &&
161
- test "$(test-urlmatch-normalization -p "x://y/%2e/")" = "x://y/" &&
162
- test "$(test-urlmatch-normalization -p "x://y/%2E/")" = "x://y/" &&
163
- test "$(test-urlmatch-normalization -p "x://y/a/%2e./")" = "x://y/" &&
164
- test "$(test-urlmatch-normalization -p "x://y/b/.%2E/")" = "x://y/" &&
165
- test "$(test-urlmatch-normalization -p "x://y/c/%2e%2E/")" = "x://y/"
148
+ test "$(test-tool urlmatch-normalization -p "x://y/.")" = "x://y/" &&
149
+ test "$(test-tool urlmatch-normalization -p "x://y/./")" = "x://y/" &&
150
+ test "$(test-tool urlmatch-normalization -p "x://y/a/.")" = "x://y/a" &&
151
+ test "$(test-tool urlmatch-normalization -p "x://y/a/./")" = "x://y/a/" &&
152
+ test "$(test-tool urlmatch-normalization -p "x://y/.?")" = "x://y/?" &&
153
+ test "$(test-tool urlmatch-normalization -p "x://y/./?")" = "x://y/?" &&
154
+ test "$(test-tool urlmatch-normalization -p "x://y/a/.?")" = "x://y/a?" &&
155
+ test "$(test-tool urlmatch-normalization -p "x://y/a/./?")" = "x://y/a/?" &&
156
+ test "$(test-tool urlmatch-normalization -p "x://y/a/./b/.././../c")" = "x://y/c" &&
157
+ test "$(test-tool urlmatch-normalization -p "x://y/a/./b/../.././c/")" = "x://y/c/" &&
158
+ test "$(test-tool urlmatch-normalization -p "x://y/a/./b/.././../c/././.././.")" = "x://y/" &&
159
+ ! test-tool urlmatch-normalization "x://y/a/./b/.././../c/././.././.." &&
160
+ test "$(test-tool urlmatch-normalization -p "x://y/a/./?/././..")" = "x://y/a/?/././.." &&
161
+ test "$(test-tool urlmatch-normalization -p "x://y/%2e/")" = "x://y/" &&
162
+ test "$(test-tool urlmatch-normalization -p "x://y/%2E/")" = "x://y/" &&
163
+ test "$(test-tool urlmatch-normalization -p "x://y/a/%2e./")" = "x://y/" &&
164
+ test "$(test-tool urlmatch-normalization -p "x://y/b/.%2E/")" = "x://y/" &&
165
+ test "$(test-tool urlmatch-normalization -p "x://y/c/%2e%2E/")" = "x://y/"
166
'
167
168
# http://@foo specifies an empty user name but does not specify a password
169
# http://foo specifies neither a user name nor a password
170
# So they should not be equivalent
171
test_expect_success 'url equivalents' '
172
- test-urlmatch-normalization "httP://x" "Http://X/" &&
173
- test-urlmatch-normalization "Http://%4d%65:%4d^%70@The.Host" "hTTP://Me:%4D^p@the.HOST:80/" &&
174
- ! test-urlmatch-normalization "https://@x.y/^" "httpS://x.y:443/^" &&
175
- test-urlmatch-normalization "https://@x.y/^" "httpS://@x.y:0443/^" &&
176
- test-urlmatch-normalization "https://@x.y/^/../abc" "httpS://@x.y:0443/abc" &&
177
- test-urlmatch-normalization "https://@x.y/^/.." "httpS://@x.y:0443/"
172
+ test-tool urlmatch-normalization "httP://x" "Http://X/" &&
173
+ test-tool urlmatch-normalization "Http://%4d%65:%4d^%70@The.Host" "hTTP://Me:%4D^p@the.HOST:80/" &&
174
+ ! test-tool urlmatch-normalization "https://@x.y/^" "httpS://x.y:443/^" &&
175
+ test-tool urlmatch-normalization "https://@x.y/^" "httpS://@x.y:0443/^" &&
176
+ test-tool urlmatch-normalization "https://@x.y/^/../abc" "httpS://@x.y:0443/abc" &&
177
+ test-tool urlmatch-normalization "https://@x.y/^/.." "httpS://@x.y:0443/"
178
'
179
180
test_done