]>
git.proxmox.com Git - libgit2.git/blob - tests/network/url/parse.c
1 #include "clar_libgit2.h"
4 static git_net_url conndata
;
6 void test_network_url_parse__initialize(void)
8 memset(&conndata
, 0, sizeof(conndata
));
11 void test_network_url_parse__cleanup(void)
13 git_net_url_dispose(&conndata
);
18 void test_network_url_parse__hostname_trivial(void)
20 cl_git_pass(git_net_url_parse(&conndata
, "http://example.com/resource"));
21 cl_assert_equal_s(conndata
.scheme
, "http");
22 cl_assert_equal_s(conndata
.host
, "example.com");
23 cl_assert_equal_s(conndata
.port
, "80");
24 cl_assert_equal_s(conndata
.path
, "/resource");
25 cl_assert_equal_p(conndata
.username
, NULL
);
26 cl_assert_equal_p(conndata
.password
, NULL
);
27 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
30 void test_network_url_parse__hostname_root(void)
32 cl_git_pass(git_net_url_parse(&conndata
, "http://example.com/"));
33 cl_assert_equal_s(conndata
.scheme
, "http");
34 cl_assert_equal_s(conndata
.host
, "example.com");
35 cl_assert_equal_s(conndata
.port
, "80");
36 cl_assert_equal_s(conndata
.path
, "/");
37 cl_assert_equal_p(conndata
.username
, NULL
);
38 cl_assert_equal_p(conndata
.password
, NULL
);
39 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
42 void test_network_url_parse__hostname_implied_root(void)
44 cl_git_pass(git_net_url_parse(&conndata
, "http://example.com"));
45 cl_assert_equal_s(conndata
.scheme
, "http");
46 cl_assert_equal_s(conndata
.host
, "example.com");
47 cl_assert_equal_s(conndata
.port
, "80");
48 cl_assert_equal_s(conndata
.path
, "/");
49 cl_assert_equal_p(conndata
.username
, NULL
);
50 cl_assert_equal_p(conndata
.password
, NULL
);
51 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
54 void test_network_url_parse__hostname_implied_root_custom_port(void)
56 cl_git_pass(git_net_url_parse(&conndata
, "http://example.com:42"));
57 cl_assert_equal_s(conndata
.scheme
, "http");
58 cl_assert_equal_s(conndata
.host
, "example.com");
59 cl_assert_equal_s(conndata
.port
, "42");
60 cl_assert_equal_s(conndata
.path
, "/");
61 cl_assert_equal_p(conndata
.username
, NULL
);
62 cl_assert_equal_p(conndata
.password
, NULL
);
63 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 0);
66 void test_network_url_parse__hostname_implied_root_empty_port(void)
68 cl_git_pass(git_net_url_parse(&conndata
, "http://example.com:"));
69 cl_assert_equal_s(conndata
.scheme
, "http");
70 cl_assert_equal_s(conndata
.host
, "example.com");
71 cl_assert_equal_s(conndata
.port
, "80");
72 cl_assert_equal_s(conndata
.path
, "/");
73 cl_assert_equal_p(conndata
.username
, NULL
);
74 cl_assert_equal_p(conndata
.password
, NULL
);
75 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
78 void test_network_url_parse__hostname_encoded_password(void)
80 cl_git_pass(git_net_url_parse(&conndata
,
81 "https://user:pass%2fis%40bad@hostname.com:1234/"));
82 cl_assert_equal_s(conndata
.scheme
, "https");
83 cl_assert_equal_s(conndata
.host
, "hostname.com");
84 cl_assert_equal_s(conndata
.port
, "1234");
85 cl_assert_equal_s(conndata
.path
, "/");
86 cl_assert_equal_s(conndata
.username
, "user");
87 cl_assert_equal_s(conndata
.password
, "pass/is@bad");
88 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 0);
91 void test_network_url_parse__hostname_user(void)
93 cl_git_pass(git_net_url_parse(&conndata
,
94 "https://user@example.com/resource"));
95 cl_assert_equal_s(conndata
.scheme
, "https");
96 cl_assert_equal_s(conndata
.host
, "example.com");
97 cl_assert_equal_s(conndata
.port
, "443");
98 cl_assert_equal_s(conndata
.path
, "/resource");
99 cl_assert_equal_s(conndata
.username
, "user");
100 cl_assert_equal_p(conndata
.password
, NULL
);
101 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
104 void test_network_url_parse__hostname_user_pass(void)
106 /* user:pass@hostname.tld/resource */
107 cl_git_pass(git_net_url_parse(&conndata
,
108 "https://user:pass@example.com/resource"));
109 cl_assert_equal_s(conndata
.scheme
, "https");
110 cl_assert_equal_s(conndata
.host
, "example.com");
111 cl_assert_equal_s(conndata
.port
, "443");
112 cl_assert_equal_s(conndata
.path
, "/resource");
113 cl_assert_equal_s(conndata
.username
, "user");
114 cl_assert_equal_s(conndata
.password
, "pass");
115 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
118 void test_network_url_parse__hostname_port(void)
120 /* hostname.tld:port/resource */
121 cl_git_pass(git_net_url_parse(&conndata
,
122 "https://example.com:9191/resource"));
123 cl_assert_equal_s(conndata
.scheme
, "https");
124 cl_assert_equal_s(conndata
.host
, "example.com");
125 cl_assert_equal_s(conndata
.port
, "9191");
126 cl_assert_equal_s(conndata
.path
, "/resource");
127 cl_assert_equal_p(conndata
.username
, NULL
);
128 cl_assert_equal_p(conndata
.password
, NULL
);
129 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 0);
132 void test_network_url_parse__hostname_empty_port(void)
134 cl_git_pass(git_net_url_parse(&conndata
, "http://example.com:/resource"));
135 cl_assert_equal_s(conndata
.scheme
, "http");
136 cl_assert_equal_s(conndata
.host
, "example.com");
137 cl_assert_equal_s(conndata
.port
, "80");
138 cl_assert_equal_s(conndata
.path
, "/resource");
139 cl_assert_equal_p(conndata
.username
, NULL
);
140 cl_assert_equal_p(conndata
.password
, NULL
);
141 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
144 void test_network_url_parse__hostname_user_port(void)
146 /* user@hostname.tld:port/resource */
147 cl_git_pass(git_net_url_parse(&conndata
,
148 "https://user@example.com:9191/resource"));
149 cl_assert_equal_s(conndata
.scheme
, "https");
150 cl_assert_equal_s(conndata
.host
, "example.com");
151 cl_assert_equal_s(conndata
.port
, "9191");
152 cl_assert_equal_s(conndata
.path
, "/resource");
153 cl_assert_equal_s(conndata
.username
, "user");
154 cl_assert_equal_p(conndata
.password
, NULL
);
155 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 0);
158 void test_network_url_parse__hostname_user_pass_port(void)
160 /* user:pass@hostname.tld:port/resource */
161 cl_git_pass(git_net_url_parse(&conndata
,
162 "https://user:pass@example.com:9191/resource"));
163 cl_assert_equal_s(conndata
.scheme
, "https");
164 cl_assert_equal_s(conndata
.host
, "example.com");
165 cl_assert_equal_s(conndata
.port
, "9191");
166 cl_assert_equal_s(conndata
.path
, "/resource");
167 cl_assert_equal_s(conndata
.username
, "user");
168 cl_assert_equal_s(conndata
.password
, "pass");
169 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 0);
174 void test_network_url_parse__ipv4_trivial(void)
176 cl_git_pass(git_net_url_parse(&conndata
, "http://192.168.1.1/resource"));
177 cl_assert_equal_s(conndata
.scheme
, "http");
178 cl_assert_equal_s(conndata
.host
, "192.168.1.1");
179 cl_assert_equal_s(conndata
.port
, "80");
180 cl_assert_equal_s(conndata
.path
, "/resource");
181 cl_assert_equal_p(conndata
.username
, NULL
);
182 cl_assert_equal_p(conndata
.password
, NULL
);
183 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
186 void test_network_url_parse__ipv4_root(void)
188 cl_git_pass(git_net_url_parse(&conndata
, "http://192.168.1.1/"));
189 cl_assert_equal_s(conndata
.scheme
, "http");
190 cl_assert_equal_s(conndata
.host
, "192.168.1.1");
191 cl_assert_equal_s(conndata
.port
, "80");
192 cl_assert_equal_s(conndata
.path
, "/");
193 cl_assert_equal_p(conndata
.username
, NULL
);
194 cl_assert_equal_p(conndata
.password
, NULL
);
195 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
198 void test_network_url_parse__ipv4_implied_root(void)
200 cl_git_pass(git_net_url_parse(&conndata
, "http://192.168.1.1"));
201 cl_assert_equal_s(conndata
.scheme
, "http");
202 cl_assert_equal_s(conndata
.host
, "192.168.1.1");
203 cl_assert_equal_s(conndata
.port
, "80");
204 cl_assert_equal_s(conndata
.path
, "/");
205 cl_assert_equal_p(conndata
.username
, NULL
);
206 cl_assert_equal_p(conndata
.password
, NULL
);
207 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
210 void test_network_url_parse__ipv4_implied_root_custom_port(void)
212 cl_git_pass(git_net_url_parse(&conndata
, "http://192.168.1.1:42"));
213 cl_assert_equal_s(conndata
.scheme
, "http");
214 cl_assert_equal_s(conndata
.host
, "192.168.1.1");
215 cl_assert_equal_s(conndata
.port
, "42");
216 cl_assert_equal_s(conndata
.path
, "/");
217 cl_assert_equal_p(conndata
.username
, NULL
);
218 cl_assert_equal_p(conndata
.password
, NULL
);
219 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 0);
222 void test_network_url_parse__ipv4_implied_root_empty_port(void)
224 cl_git_pass(git_net_url_parse(&conndata
, "http://192.168.1.1:"));
225 cl_assert_equal_s(conndata
.scheme
, "http");
226 cl_assert_equal_s(conndata
.host
, "192.168.1.1");
227 cl_assert_equal_s(conndata
.port
, "80");
228 cl_assert_equal_s(conndata
.path
, "/");
229 cl_assert_equal_p(conndata
.username
, NULL
);
230 cl_assert_equal_p(conndata
.password
, NULL
);
231 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
234 void test_network_url_parse__ipv4_encoded_password(void)
236 cl_git_pass(git_net_url_parse(&conndata
,
237 "https://user:pass%2fis%40bad@192.168.1.1:1234/"));
238 cl_assert_equal_s(conndata
.scheme
, "https");
239 cl_assert_equal_s(conndata
.host
, "192.168.1.1");
240 cl_assert_equal_s(conndata
.port
, "1234");
241 cl_assert_equal_s(conndata
.path
, "/");
242 cl_assert_equal_s(conndata
.username
, "user");
243 cl_assert_equal_s(conndata
.password
, "pass/is@bad");
244 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 0);
247 void test_network_url_parse__ipv4_user(void)
249 cl_git_pass(git_net_url_parse(&conndata
,
250 "https://user@192.168.1.1/resource"));
251 cl_assert_equal_s(conndata
.scheme
, "https");
252 cl_assert_equal_s(conndata
.host
, "192.168.1.1");
253 cl_assert_equal_s(conndata
.port
, "443");
254 cl_assert_equal_s(conndata
.path
, "/resource");
255 cl_assert_equal_s(conndata
.username
, "user");
256 cl_assert_equal_p(conndata
.password
, NULL
);
257 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
260 void test_network_url_parse__ipv4_user_pass(void)
262 cl_git_pass(git_net_url_parse(&conndata
,
263 "https://user:pass@192.168.1.1/resource"));
264 cl_assert_equal_s(conndata
.scheme
, "https");
265 cl_assert_equal_s(conndata
.host
, "192.168.1.1");
266 cl_assert_equal_s(conndata
.port
, "443");
267 cl_assert_equal_s(conndata
.path
, "/resource");
268 cl_assert_equal_s(conndata
.username
, "user");
269 cl_assert_equal_s(conndata
.password
, "pass");
270 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
273 void test_network_url_parse__ipv4_port(void)
275 cl_git_pass(git_net_url_parse(&conndata
,
276 "https://192.168.1.1:9191/resource"));
277 cl_assert_equal_s(conndata
.scheme
, "https");
278 cl_assert_equal_s(conndata
.host
, "192.168.1.1");
279 cl_assert_equal_s(conndata
.port
, "9191");
280 cl_assert_equal_s(conndata
.path
, "/resource");
281 cl_assert_equal_p(conndata
.username
, NULL
);
282 cl_assert_equal_p(conndata
.password
, NULL
);
283 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 0);
286 void test_network_url_parse__ipv4_empty_port(void)
288 cl_git_pass(git_net_url_parse(&conndata
, "http://192.168.1.1:/resource"));
289 cl_assert_equal_s(conndata
.scheme
, "http");
290 cl_assert_equal_s(conndata
.host
, "192.168.1.1");
291 cl_assert_equal_s(conndata
.port
, "80");
292 cl_assert_equal_s(conndata
.path
, "/resource");
293 cl_assert_equal_p(conndata
.username
, NULL
);
294 cl_assert_equal_p(conndata
.password
, NULL
);
295 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
298 void test_network_url_parse__ipv4_user_port(void)
300 cl_git_pass(git_net_url_parse(&conndata
,
301 "https://user@192.168.1.1:9191/resource"));
302 cl_assert_equal_s(conndata
.scheme
, "https");
303 cl_assert_equal_s(conndata
.host
, "192.168.1.1");
304 cl_assert_equal_s(conndata
.port
, "9191");
305 cl_assert_equal_s(conndata
.path
, "/resource");
306 cl_assert_equal_s(conndata
.username
, "user");
307 cl_assert_equal_p(conndata
.password
, NULL
);
308 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 0);
311 void test_network_url_parse__ipv4_user_pass_port(void)
313 cl_git_pass(git_net_url_parse(&conndata
,
314 "https://user:pass@192.168.1.1:9191/resource"));
315 cl_assert_equal_s(conndata
.scheme
, "https");
316 cl_assert_equal_s(conndata
.host
, "192.168.1.1");
317 cl_assert_equal_s(conndata
.port
, "9191");
318 cl_assert_equal_s(conndata
.path
, "/resource");
319 cl_assert_equal_s(conndata
.username
, "user");
320 cl_assert_equal_s(conndata
.password
, "pass");
321 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 0);
326 void test_network_url_parse__ipv6_trivial(void)
328 cl_git_pass(git_net_url_parse(&conndata
, "http://[fe80::dcad:beff:fe00:0001]/resource"));
329 cl_assert_equal_s(conndata
.scheme
, "http");
330 cl_assert_equal_s(conndata
.host
, "fe80::dcad:beff:fe00:0001");
331 cl_assert_equal_s(conndata
.port
, "80");
332 cl_assert_equal_s(conndata
.path
, "/resource");
333 cl_assert_equal_p(conndata
.username
, NULL
);
334 cl_assert_equal_p(conndata
.password
, NULL
);
335 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
338 void test_network_url_parse__ipv6_root(void)
340 cl_git_pass(git_net_url_parse(&conndata
, "http://[fe80::dcad:beff:fe00:0001]/"));
341 cl_assert_equal_s(conndata
.scheme
, "http");
342 cl_assert_equal_s(conndata
.host
, "fe80::dcad:beff:fe00:0001");
343 cl_assert_equal_s(conndata
.port
, "80");
344 cl_assert_equal_s(conndata
.path
, "/");
345 cl_assert_equal_p(conndata
.username
, NULL
);
346 cl_assert_equal_p(conndata
.password
, NULL
);
347 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
350 void test_network_url_parse__ipv6_implied_root(void)
352 cl_git_pass(git_net_url_parse(&conndata
, "http://[fe80::dcad:beff:fe00:0001]"));
353 cl_assert_equal_s(conndata
.scheme
, "http");
354 cl_assert_equal_s(conndata
.host
, "fe80::dcad:beff:fe00:0001");
355 cl_assert_equal_s(conndata
.port
, "80");
356 cl_assert_equal_s(conndata
.path
, "/");
357 cl_assert_equal_p(conndata
.username
, NULL
);
358 cl_assert_equal_p(conndata
.password
, NULL
);
359 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
362 void test_network_url_parse__ipv6_implied_root_custom_port(void)
364 cl_git_pass(git_net_url_parse(&conndata
, "http://[fe80::dcad:beff:fe00:0001]:42"));
365 cl_assert_equal_s(conndata
.scheme
, "http");
366 cl_assert_equal_s(conndata
.host
, "fe80::dcad:beff:fe00:0001");
367 cl_assert_equal_s(conndata
.port
, "42");
368 cl_assert_equal_s(conndata
.path
, "/");
369 cl_assert_equal_p(conndata
.username
, NULL
);
370 cl_assert_equal_p(conndata
.password
, NULL
);
371 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 0);
374 void test_network_url_parse__ipv6_implied_root_empty_port(void)
376 cl_git_pass(git_net_url_parse(&conndata
, "http://[fe80::dcad:beff:fe00:0001]:"));
377 cl_assert_equal_s(conndata
.scheme
, "http");
378 cl_assert_equal_s(conndata
.host
, "fe80::dcad:beff:fe00:0001");
379 cl_assert_equal_s(conndata
.port
, "80");
380 cl_assert_equal_s(conndata
.path
, "/");
381 cl_assert_equal_p(conndata
.username
, NULL
);
382 cl_assert_equal_p(conndata
.password
, NULL
);
383 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
386 void test_network_url_parse__ipv6_encoded_password(void)
388 cl_git_pass(git_net_url_parse(&conndata
,
389 "https://user:pass%2fis%40bad@[fe80::dcad:beff:fe00:0001]:1234/"));
390 cl_assert_equal_s(conndata
.scheme
, "https");
391 cl_assert_equal_s(conndata
.host
, "fe80::dcad:beff:fe00:0001");
392 cl_assert_equal_s(conndata
.port
, "1234");
393 cl_assert_equal_s(conndata
.path
, "/");
394 cl_assert_equal_s(conndata
.username
, "user");
395 cl_assert_equal_s(conndata
.password
, "pass/is@bad");
396 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 0);
399 void test_network_url_parse__ipv6_user(void)
401 cl_git_pass(git_net_url_parse(&conndata
,
402 "https://user@[fe80::dcad:beff:fe00:0001]/resource"));
403 cl_assert_equal_s(conndata
.scheme
, "https");
404 cl_assert_equal_s(conndata
.host
, "fe80::dcad:beff:fe00:0001");
405 cl_assert_equal_s(conndata
.port
, "443");
406 cl_assert_equal_s(conndata
.path
, "/resource");
407 cl_assert_equal_s(conndata
.username
, "user");
408 cl_assert_equal_p(conndata
.password
, NULL
);
409 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
412 void test_network_url_parse__ipv6_user_pass(void)
414 cl_git_pass(git_net_url_parse(&conndata
,
415 "https://user:pass@[fe80::dcad:beff:fe00:0001]/resource"));
416 cl_assert_equal_s(conndata
.scheme
, "https");
417 cl_assert_equal_s(conndata
.host
, "fe80::dcad:beff:fe00:0001");
418 cl_assert_equal_s(conndata
.port
, "443");
419 cl_assert_equal_s(conndata
.path
, "/resource");
420 cl_assert_equal_s(conndata
.username
, "user");
421 cl_assert_equal_s(conndata
.password
, "pass");
422 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
425 void test_network_url_parse__ipv6_port(void)
427 cl_git_pass(git_net_url_parse(&conndata
,
428 "https://[fe80::dcad:beff:fe00:0001]:9191/resource"));
429 cl_assert_equal_s(conndata
.scheme
, "https");
430 cl_assert_equal_s(conndata
.host
, "fe80::dcad:beff:fe00:0001");
431 cl_assert_equal_s(conndata
.port
, "9191");
432 cl_assert_equal_s(conndata
.path
, "/resource");
433 cl_assert_equal_p(conndata
.username
, NULL
);
434 cl_assert_equal_p(conndata
.password
, NULL
);
435 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 0);
438 void test_network_url_parse__ipv6_empty_port(void)
440 cl_git_pass(git_net_url_parse(&conndata
, "http://[fe80::dcad:beff:fe00:0001]:/resource"));
441 cl_assert_equal_s(conndata
.scheme
, "http");
442 cl_assert_equal_s(conndata
.host
, "fe80::dcad:beff:fe00:0001");
443 cl_assert_equal_s(conndata
.port
, "80");
444 cl_assert_equal_s(conndata
.path
, "/resource");
445 cl_assert_equal_p(conndata
.username
, NULL
);
446 cl_assert_equal_p(conndata
.password
, NULL
);
447 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 1);
450 void test_network_url_parse__ipv6_user_port(void)
452 cl_git_pass(git_net_url_parse(&conndata
,
453 "https://user@[fe80::dcad:beff:fe00:0001]:9191/resource"));
454 cl_assert_equal_s(conndata
.scheme
, "https");
455 cl_assert_equal_s(conndata
.host
, "fe80::dcad:beff:fe00:0001");
456 cl_assert_equal_s(conndata
.port
, "9191");
457 cl_assert_equal_s(conndata
.path
, "/resource");
458 cl_assert_equal_s(conndata
.username
, "user");
459 cl_assert_equal_p(conndata
.password
, NULL
);
460 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 0);
463 void test_network_url_parse__ipv6_user_pass_port(void)
465 cl_git_pass(git_net_url_parse(&conndata
,
466 "https://user:pass@[fe80::dcad:beff:fe00:0001]:9191/resource"));
467 cl_assert_equal_s(conndata
.scheme
, "https");
468 cl_assert_equal_s(conndata
.host
, "fe80::dcad:beff:fe00:0001");
469 cl_assert_equal_s(conndata
.port
, "9191");
470 cl_assert_equal_s(conndata
.path
, "/resource");
471 cl_assert_equal_s(conndata
.username
, "user");
472 cl_assert_equal_s(conndata
.password
, "pass");
473 cl_assert_equal_i(git_net_url_is_default_port(&conndata
), 0);
476 void test_network_url_parse__ipv6_invalid_addresses(void)
478 /* Opening bracket missing */
479 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
480 "http://fe80::dcad:beff:fe00:0001]/resource"));
481 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
482 "http://fe80::dcad:beff:fe00:0001]/"));
483 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
484 "http://fe80::dcad:beff:fe00:0001]"));
485 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
486 "http://fe80::dcad:beff:fe00:0001]:42"));
487 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
488 "http://fe80::dcad:beff:fe00:0001]:"));
489 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
490 "https://user:pass%2fis%40bad@fe80::dcad:beff:fe00:0001]:1234/"));
491 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
492 "https://user@fe80::dcad:beff:fe00:0001]/resource"));
493 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
494 "https://user:pass@fe80::dcad:beff:fe00:0001]/resource"));
495 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
496 "https://fe80::dcad:beff:fe00:0001]:9191/resource"));
497 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
498 "http://fe80::dcad:beff:fe00:0001]:/resource"));
499 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
500 "https://user@fe80::dcad:beff:fe00:0001]:9191/resource"));
501 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
502 "https://user:pass@fe80::dcad:beff:fe00:0001]:9191/resource"));
504 /* Closing bracket missing */
505 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
506 "http://[fe80::dcad:beff:fe00:0001/resource"));
507 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
508 "http://[fe80::dcad:beff:fe00:0001/"));
509 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
510 "http://[fe80::dcad:beff:fe00:0001"));
511 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
512 "http://[fe80::dcad:beff:fe00:0001:42"));
513 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
514 "http://[fe80::dcad:beff:fe00:0001:"));
515 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
516 "https://user:pass%2fis%40bad@[fe80::dcad:beff:fe00:0001:1234/"));
517 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
518 "https://user@[fe80::dcad:beff:fe00:0001/resource"));
519 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
520 "https://user:pass@[fe80::dcad:beff:fe00:0001/resource"));
521 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
522 "https://[fe80::dcad:beff:fe00:0001:9191/resource"));
523 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
524 "http://[fe80::dcad:beff:fe00:0001:/resource"));
525 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
526 "https://user@[fe80::dcad:beff:fe00:0001:9191/resource"));
527 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
528 "https://user:pass@[fe80::dcad:beff:fe00:0001:9191/resource"));
529 /* Both brackets missing */
530 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
531 "http://fe80::dcad:beff:fe00:0001/resource"));
532 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
533 "http://fe80::dcad:beff:fe00:0001/"));
534 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
535 "http://fe80::dcad:beff:fe00:0001"));
536 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
537 "http://fe80::dcad:beff:fe00:0001:42"));
538 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
539 "http://fe80::dcad:beff:fe00:0001:"));
540 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
541 "https://user:pass%2fis%40bad@fe80::dcad:beff:fe00:0001:1234/"));
542 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
543 "https://user@fe80::dcad:beff:fe00:0001/resource"));
544 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
545 "https://user:pass@fe80::dcad:beff:fe00:0001/resource"));
546 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
547 "https://fe80::dcad:beff:fe00:0001:9191/resource"));
548 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
549 "http://fe80::dcad:beff:fe00:0001:/resource"));
550 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
551 "https://user@fe80::dcad:beff:fe00:0001:9191/resource"));
552 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
,
553 "https://user:pass@fe80::dcad:beff:fe00:0001:9191/resource"));
555 /* Invalid character inside address */
556 cl_git_fail_with(GIT_EINVALIDSPEC
, git_net_url_parse(&conndata
, "http://[fe8o::dcad:beff:fe00:0001]/resource"));