| ... | @@ -14,8 +14,9 @@ pub fn parseFail(input: []const u8, base: ?[]const u8) !void { | ... | @@ -14,8 +14,9 @@ pub fn parseFail(input: []const u8, base: ?[]const u8) !void { |
| 14 | } | 14 | } |
| 15 | | 15 | |
| 16 | pub fn parsePass(input: []const u8, base: ?[]const u8, href: []const u8, origin: []const u8, protocol: []const u8, username: []const u8, password: []const u8, host: []const u8, hostname: []const u8, port: []const u8, pathname: []const u8, search: []const u8, hash: []const u8) !void { | 16 | pub fn parsePass(input: []const u8, base: ?[]const u8, href: []const u8, origin: []const u8, protocol: []const u8, username: []const u8, password: []const u8, host: []const u8, hostname: []const u8, port: []const u8, pathname: []const u8, search: []const u8, hash: []const u8) !void { |
| 17 | _ = input; | 17 | const allocator = std.testing.allocator; |
| 18 | _ = base; | 18 | const u = try url.URL.parse(allocator, input, base); |
| | 19 | defer allocator.free(u.href); |
| 19 | _ = href; | 20 | _ = href; |
| 20 | _ = origin; | 21 | _ = origin; |
| 21 | _ = protocol; | 22 | _ = protocol; |
| ... | @@ -27,7 +28,6 @@ pub fn parsePass(input: []const u8, base: ?[]const u8, href: []const u8, origin: | ... | @@ -27,7 +28,6 @@ pub fn parsePass(input: []const u8, base: ?[]const u8, href: []const u8, origin: |
| 27 | _ = pathname; | 28 | _ = pathname; |
| 28 | _ = search; | 29 | _ = search; |
| 29 | _ = hash; | 30 | _ = hash; |
| 30 | return error.SkipZigTest; | | |
| 31 | } | 31 | } |
| 32 | | 32 | |
| 33 | pub fn parseIDNAFail(input: []const u8) !void { | 33 | pub fn parseIDNAFail(input: []const u8) !void { |
| ... | @@ -262,6 +262,334 @@ test { try parseFail("stun://[:1]", null); } | ... | @@ -262,6 +262,334 @@ test { try parseFail("stun://[:1]", null); } |
| 262 | test { try parseFail("non-special://host\\a", null); } | 262 | test { try parseFail("non-special://host\\a", null); } |
| 263 | | 263 | |
| 264 | | 264 | |
| | 265 | test { try parsePass("https://test:@test", null, "https://test@test/", "https://test", "https:", "test", "", "test", "test", "", "/", "", ""); } |
| | 266 | test { try parsePass("https://:@test", null, "https://test/", "https://test", "https:", "", "", "test", "test", "", "/", "", ""); } |
| | 267 | test { try parsePass("non-special://test:@test/x", null, "non-special://test@test/x", "null", "non-special:", "test", "", "test", "test", "", "/x", "", ""); } |
| | 268 | test { try parsePass("non-special://:@test/x", null, "non-special://test/x", "null", "non-special:", "", "", "test", "test", "", "/x", "", ""); } |
| | 269 | test { try parsePass("lolscheme:x x#x x", null, "lolscheme:x x#x%20x", "", "lolscheme:", "", "", "", "", "", "x x", "", "#x%20x"); } |
| | 270 | test { try parsePass("http://a:b@c\\", null, "http://a:b@c/", "http://c", "http:", "a", "b", "c", "c", "", "/", "", ""); } |
| | 271 | test { try parsePass("ws://a@b\\c", null, "ws://a@b/c", "ws://b", "ws:", "a", "", "b", "b", "", "/c", "", ""); } |
| | 272 | test { try parsePass("file:///w|m", null, "file:///w|m", "", "file:", "", "", "", "", "", "/w|m", "", ""); } |
| | 273 | test { try parsePass("file:///w||m", null, "file:///w||m", "", "file:", "", "", "", "", "", "/w||m", "", ""); } |
| | 274 | test { try parsePass("file:///w|/m", null, "file:///w:/m", "", "file:", "", "", "", "", "", "/w:/m", "", ""); } |
| | 275 | test { try parsePass("file:C|/m/", null, "file:///C:/m/", "", "file:", "", "", "", "", "", "/C:/m/", "", ""); } |
| | 276 | test { try parsePass("file:C||/m/", null, "file:///C||/m/", "", "file:", "", "", "", "", "", "/C||/m/", "", ""); } |
| | 277 | test { try parsePass("http://example.com/././foo", null, "http://example.com/foo", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/foo", "", ""); } |
| | 278 | test { try parsePass("http://example.com/./.foo", null, "http://example.com/.foo", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/.foo", "", ""); } |
| | 279 | test { try parsePass("http://example.com/foo/.", null, "http://example.com/foo/", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/foo/", "", ""); } |
| | 280 | test { try parsePass("http://example.com/foo/./", null, "http://example.com/foo/", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/foo/", "", ""); } |
| | 281 | test { try parsePass("http://example.com/foo/bar/..", null, "http://example.com/foo/", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/foo/", "", ""); } |
| | 282 | test { try parsePass("http://example.com/foo/bar/../", null, "http://example.com/foo/", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/foo/", "", ""); } |
| | 283 | test { try parsePass("http://example.com/foo/..bar", null, "http://example.com/foo/..bar", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/foo/..bar", "", ""); } |
| | 284 | test { try parsePass("http://example.com/foo/bar/../ton", null, "http://example.com/foo/ton", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/foo/ton", "", ""); } |
| | 285 | test { try parsePass("http://example.com/foo/bar/../ton/../../a", null, "http://example.com/a", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/a", "", ""); } |
| | 286 | test { try parsePass("http://example.com/foo/../../..", null, "http://example.com/", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/", "", ""); } |
| | 287 | test { try parsePass("http://example.com/foo/../../../ton", null, "http://example.com/ton", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/ton", "", ""); } |
| | 288 | test { try parsePass("http://example.com/foo/%2e", null, "http://example.com/foo/", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/foo/", "", ""); } |
| | 289 | test { try parsePass("http://example.com/foo/%2e%2", null, "http://example.com/foo/%2e%2", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/foo/%2e%2", "", ""); } |
| | 290 | test { try parsePass("http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar", null, "http://example.com/%2e.bar", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/%2e.bar", "", ""); } |
| | 291 | test { try parsePass("http://example.com////../..", null, "http://example.com//", "http://example.com", "http:", "", "", "example.com", "example.com", "", "//", "", ""); } |
| | 292 | test { try parsePass("http://example.com/foo/bar//../..", null, "http://example.com/foo/", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/foo/", "", ""); } |
| | 293 | test { try parsePass("http://example.com/foo/bar//..", null, "http://example.com/foo/bar/", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/foo/bar/", "", ""); } |
| | 294 | test { try parsePass("http://example.com/foo", null, "http://example.com/foo", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/foo", "", ""); } |
| | 295 | test { try parsePass("http://example.com/%20foo", null, "http://example.com/%20foo", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/%20foo", "", ""); } |
| | 296 | test { try parsePass("http://example.com/foo%", null, "http://example.com/foo%", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/foo%", "", ""); } |
| | 297 | test { try parsePass("http://example.com/foo%2", null, "http://example.com/foo%2", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/foo%2", "", ""); } |
| | 298 | test { try parsePass("http://example.com/foo%2zbar", null, "http://example.com/foo%2zbar", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/foo%2zbar", "", ""); } |
| | 299 | test { try parsePass("http://example.com/foo%2\xc2\xa9zbar", null, "http://example.com/foo%2%C3%82%C2%A9zbar", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/foo%2%C3%82%C2%A9zbar", "", ""); } |
| | 300 | test { try parsePass("http://example.com/foo%41%7a", null, "http://example.com/foo%41%7a", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/foo%41%7a", "", ""); } |
| | 301 | test { try parsePass("http://example.com/foo\t\x91%91", null, "http://example.com/foo%C2%91%91", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/foo%C2%91%91", "", ""); } |
| | 302 | test { try parsePass("http://example.com/foo%00%51", null, "http://example.com/foo%00%51", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/foo%00%51", "", ""); } |
| | 303 | test { try parsePass("http://example.com/(%28:%3A%29)", null, "http://example.com/(%28:%3A%29)", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/(%28:%3A%29)", "", ""); } |
| | 304 | test { try parsePass("http://example.com/%3A%3a%3C%3c", null, "http://example.com/%3A%3a%3C%3c", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/%3A%3a%3C%3c", "", ""); } |
| | 305 | test { try parsePass("http://example.com/foo\tbar", null, "http://example.com/foobar", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/foobar", "", ""); } |
| | 306 | test { try parsePass("http://example.com\\\\foo\\\\bar", null, "http://example.com//foo//bar", "http://example.com", "http:", "", "", "example.com", "example.com", "", "//foo//bar", "", ""); } |
| | 307 | test { try parsePass("http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd", null, "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/%7Ffp3%3Eju%3Dduvgw%3Dd", "", ""); } |
| | 308 | test { try parsePass("http://example.com/@asdf%40", null, "http://example.com/@asdf%40", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/@asdf%40", "", ""); } |
| | 309 | test { try parsePass("http://example.com/\x4f60\x597d\x4f60\x597d", null, "http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD", "", ""); } |
| | 310 | test { try parsePass("http://example.com/\x2025/foo", null, "http://example.com/%E2%80%A5/foo", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/%E2%80%A5/foo", "", ""); } |
| | 311 | test { try parsePass("http://example.com/\xfeff/foo", null, "http://example.com/%EF%BB%BF/foo", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/%EF%BB%BF/foo", "", ""); } |
| | 312 | test { try parsePass("http://example.com/\x202e/foo/\x202d/bar", null, "http://example.com/%E2%80%AE/foo/%E2%80%AD/bar", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/%E2%80%AE/foo/%E2%80%AD/bar", "", ""); } |
| | 313 | test { try parsePass("http://www.google.com/foo?bar=baz#", null, "http://www.google.com/foo?bar=baz#", "http://www.google.com", "http:", "", "", "www.google.com", "www.google.com", "", "/foo", "?bar=baz", ""); } |
| | 314 | test { try parsePass("http://www.google.com/foo?bar=baz# \xbb", null, "http://www.google.com/foo?bar=baz#%20%C2%BB", "http://www.google.com", "http:", "", "", "www.google.com", "www.google.com", "", "/foo", "?bar=baz", "#%20%C2%BB"); } |
| | 315 | test { try parsePass("data:test# \xbb", null, "data:test#%20%C2%BB", "null", "data:", "", "", "", "", "", "test", "", "#%20%C2%BB"); } |
| | 316 | test { try parsePass("http://www.google.com", null, "http://www.google.com/", "http://www.google.com", "http:", "", "", "www.google.com", "www.google.com", "", "/", "", ""); } |
| | 317 | test { try parsePass("http://192.0x00A80001", null, "http://192.168.0.1/", "http://192.168.0.1", "http:", "", "", "192.168.0.1", "192.168.0.1", "", "/", "", ""); } |
| | 318 | test { try parsePass("http://www/foo%2Ehtml", null, "http://www/foo%2Ehtml", "http://www", "http:", "", "", "www", "www", "", "/foo%2Ehtml", "", ""); } |
| | 319 | test { try parsePass("http://www/foo/%2E/html", null, "http://www/foo/html", "http://www", "http:", "", "", "www", "www", "", "/foo/html", "", ""); } |
| | 320 | test { try parsePass("http://%25DOMAIN:foobar@foodomain.com/", null, "http://%25DOMAIN:foobar@foodomain.com/", "http://foodomain.com", "http:", "%25DOMAIN", "foobar", "foodomain.com", "foodomain.com", "", "/", "", ""); } |
| | 321 | test { try parsePass("http:\\\\www.google.com\\foo", null, "http://www.google.com/foo", "http://www.google.com", "http:", "", "", "www.google.com", "www.google.com", "", "/foo", "", ""); } |
| | 322 | test { try parsePass("http://foo:80/", null, "http://foo/", "http://foo", "http:", "", "", "foo", "foo", "", "/", "", ""); } |
| | 323 | test { try parsePass("http://foo:81/", null, "http://foo:81/", "http://foo:81", "http:", "", "", "foo:81", "foo", "81", "/", "", ""); } |
| | 324 | test { try parsePass("httpa://foo:80/", null, "httpa://foo:80/", "null", "httpa:", "", "", "foo:80", "foo", "80", "/", "", ""); } |
| | 325 | test { try parsePass("https://foo:443/", null, "https://foo/", "https://foo", "https:", "", "", "foo", "foo", "", "/", "", ""); } |
| | 326 | test { try parsePass("https://foo:80/", null, "https://foo:80/", "https://foo:80", "https:", "", "", "foo:80", "foo", "80", "/", "", ""); } |
| | 327 | test { try parsePass("ftp://foo:21/", null, "ftp://foo/", "ftp://foo", "ftp:", "", "", "foo", "foo", "", "/", "", ""); } |
| | 328 | test { try parsePass("ftp://foo:80/", null, "ftp://foo:80/", "ftp://foo:80", "ftp:", "", "", "foo:80", "foo", "80", "/", "", ""); } |
| | 329 | test { try parsePass("gopher://foo:70/", null, "gopher://foo:70/", "null", "gopher:", "", "", "foo:70", "foo", "70", "/", "", ""); } |
| | 330 | test { try parsePass("gopher://foo:443/", null, "gopher://foo:443/", "null", "gopher:", "", "", "foo:443", "foo", "443", "/", "", ""); } |
| | 331 | test { try parsePass("ws://foo:80/", null, "ws://foo/", "ws://foo", "ws:", "", "", "foo", "foo", "", "/", "", ""); } |
| | 332 | test { try parsePass("ws://foo:81/", null, "ws://foo:81/", "ws://foo:81", "ws:", "", "", "foo:81", "foo", "81", "/", "", ""); } |
| | 333 | test { try parsePass("ws://foo:443/", null, "ws://foo:443/", "ws://foo:443", "ws:", "", "", "foo:443", "foo", "443", "/", "", ""); } |
| | 334 | test { try parsePass("ws://foo:815/", null, "ws://foo:815/", "ws://foo:815", "ws:", "", "", "foo:815", "foo", "815", "/", "", ""); } |
| | 335 | test { try parsePass("wss://foo:80/", null, "wss://foo:80/", "wss://foo:80", "wss:", "", "", "foo:80", "foo", "80", "/", "", ""); } |
| | 336 | test { try parsePass("wss://foo:81/", null, "wss://foo:81/", "wss://foo:81", "wss:", "", "", "foo:81", "foo", "81", "/", "", ""); } |
| | 337 | test { try parsePass("wss://foo:443/", null, "wss://foo/", "wss://foo", "wss:", "", "", "foo", "foo", "", "/", "", ""); } |
| | 338 | test { try parsePass("wss://foo:815/", null, "wss://foo:815/", "wss://foo:815", "wss:", "", "", "foo:815", "foo", "815", "/", "", ""); } |
| | 339 | test { try parsePass("http:/example.com/", null, "http://example.com/", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/", "", ""); } |
| | 340 | test { try parsePass("ftp:/example.com/", null, "ftp://example.com/", "ftp://example.com", "ftp:", "", "", "example.com", "example.com", "", "/", "", ""); } |
| | 341 | test { try parsePass("https:/example.com/", null, "https://example.com/", "https://example.com", "https:", "", "", "example.com", "example.com", "", "/", "", ""); } |
| | 342 | test { try parsePass("madeupscheme:/example.com/", null, "madeupscheme:/example.com/", "null", "madeupscheme:", "", "", "", "", "", "/example.com/", "", ""); } |
| | 343 | test { try parsePass("file:/example.com/", null, "file:///example.com/", "", "file:", "", "", "", "", "", "/example.com/", "", ""); } |
| | 344 | test { try parsePass("ftps:/example.com/", null, "ftps:/example.com/", "null", "ftps:", "", "", "", "", "", "/example.com/", "", ""); } |
| | 345 | test { try parsePass("gopher:/example.com/", null, "gopher:/example.com/", "null", "gopher:", "", "", "", "", "", "/example.com/", "", ""); } |
| | 346 | test { try parsePass("ws:/example.com/", null, "ws://example.com/", "ws://example.com", "ws:", "", "", "example.com", "example.com", "", "/", "", ""); } |
| | 347 | test { try parsePass("wss:/example.com/", null, "wss://example.com/", "wss://example.com", "wss:", "", "", "example.com", "example.com", "", "/", "", ""); } |
| | 348 | test { try parsePass("data:/example.com/", null, "data:/example.com/", "null", "data:", "", "", "", "", "", "/example.com/", "", ""); } |
| | 349 | test { try parsePass("javascript:/example.com/", null, "javascript:/example.com/", "null", "javascript:", "", "", "", "", "", "/example.com/", "", ""); } |
| | 350 | test { try parsePass("mailto:/example.com/", null, "mailto:/example.com/", "null", "mailto:", "", "", "", "", "", "/example.com/", "", ""); } |
| | 351 | test { try parsePass("http:example.com/", null, "http://example.com/", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/", "", ""); } |
| | 352 | test { try parsePass("ftp:example.com/", null, "ftp://example.com/", "ftp://example.com", "ftp:", "", "", "example.com", "example.com", "", "/", "", ""); } |
| | 353 | test { try parsePass("https:example.com/", null, "https://example.com/", "https://example.com", "https:", "", "", "example.com", "example.com", "", "/", "", ""); } |
| | 354 | test { try parsePass("madeupscheme:example.com/", null, "madeupscheme:example.com/", "null", "madeupscheme:", "", "", "", "", "", "example.com/", "", ""); } |
| | 355 | test { try parsePass("ftps:example.com/", null, "ftps:example.com/", "null", "ftps:", "", "", "", "", "", "example.com/", "", ""); } |
| | 356 | test { try parsePass("gopher:example.com/", null, "gopher:example.com/", "null", "gopher:", "", "", "", "", "", "example.com/", "", ""); } |
| | 357 | test { try parsePass("ws:example.com/", null, "ws://example.com/", "ws://example.com", "ws:", "", "", "example.com", "example.com", "", "/", "", ""); } |
| | 358 | test { try parsePass("wss:example.com/", null, "wss://example.com/", "wss://example.com", "wss:", "", "", "example.com", "example.com", "", "/", "", ""); } |
| | 359 | test { try parsePass("data:example.com/", null, "data:example.com/", "null", "data:", "", "", "", "", "", "example.com/", "", ""); } |
| | 360 | test { try parsePass("javascript:example.com/", null, "javascript:example.com/", "null", "javascript:", "", "", "", "", "", "example.com/", "", ""); } |
| | 361 | test { try parsePass("mailto:example.com/", null, "mailto:example.com/", "null", "mailto:", "", "", "", "", "", "example.com/", "", ""); } |
| | 362 | test { try parsePass("https://example.com/aaa/bbb/%2e%2e?query", null, "https://example.com/aaa/?query", "https://example.com", "https:", "", "", "example.com", "example.com", "", "/aaa/", "?query", ""); } |
| | 363 | test { try parsePass("http:@www.example.com", null, "http://www.example.com/", "http://www.example.com", "http:", "", "", "www.example.com", "www.example.com", "", "/", "", ""); } |
| | 364 | test { try parsePass("http:/@www.example.com", null, "http://www.example.com/", "http://www.example.com", "http:", "", "", "www.example.com", "www.example.com", "", "/", "", ""); } |
| | 365 | test { try parsePass("http://@www.example.com", null, "http://www.example.com/", "http://www.example.com", "http:", "", "", "www.example.com", "www.example.com", "", "/", "", ""); } |
| | 366 | test { try parsePass("http:a:b@www.example.com", null, "http://a:b@www.example.com/", "http://www.example.com", "http:", "a", "b", "www.example.com", "www.example.com", "", "/", "", ""); } |
| | 367 | test { try parsePass("http:/a:b@www.example.com", null, "http://a:b@www.example.com/", "http://www.example.com", "http:", "a", "b", "www.example.com", "www.example.com", "", "/", "", ""); } |
| | 368 | test { try parsePass("http://a:b@www.example.com", null, "http://a:b@www.example.com/", "http://www.example.com", "http:", "a", "b", "www.example.com", "www.example.com", "", "/", "", ""); } |
| | 369 | test { try parsePass("http://@pple.com", null, "http://pple.com/", "http://pple.com", "http:", "", "", "pple.com", "pple.com", "", "/", "", ""); } |
| | 370 | test { try parsePass("http::b@www.example.com", null, "http://:b@www.example.com/", "http://www.example.com", "http:", "", "b", "www.example.com", "www.example.com", "", "/", "", ""); } |
| | 371 | test { try parsePass("http:/:b@www.example.com", null, "http://:b@www.example.com/", "http://www.example.com", "http:", "", "b", "www.example.com", "www.example.com", "", "/", "", ""); } |
| | 372 | test { try parsePass("http://:b@www.example.com", null, "http://:b@www.example.com/", "http://www.example.com", "http:", "", "b", "www.example.com", "www.example.com", "", "/", "", ""); } |
| | 373 | test { try parsePass("http:a:@www.example.com", null, "http://a@www.example.com/", "http://www.example.com", "http:", "a", "", "www.example.com", "www.example.com", "", "/", "", ""); } |
| | 374 | test { try parsePass("http:/a:@www.example.com", null, "http://a@www.example.com/", "http://www.example.com", "http:", "a", "", "www.example.com", "www.example.com", "", "/", "", ""); } |
| | 375 | test { try parsePass("http://a:@www.example.com", null, "http://a@www.example.com/", "http://www.example.com", "http:", "a", "", "www.example.com", "www.example.com", "", "/", "", ""); } |
| | 376 | test { try parsePass("http://www.@pple.com", null, "http://www.@pple.com/", "http://pple.com", "http:", "www.", "", "pple.com", "pple.com", "", "/", "", ""); } |
| | 377 | test { try parsePass("http://:@www.example.com", null, "http://www.example.com/", "http://www.example.com", "http:", "", "", "www.example.com", "www.example.com", "", "/", "", ""); } |
| | 378 | test { try parsePass("file:.", null, "file:///", "", "file:", "", "", "", "", "", "/", "", ""); } |
| | 379 | test { try parsePass("\x00\x1b\x04\x12 http://example.com/\x1f \r ", null, "http://example.com/", "http://example.com", "http:", "", "", "example.com", "example.com", "", "/", "", ""); } |
| | 380 | test { try parsePass("non-special:opaque ", null, "non-special:opaque", "null", "non-special:", "", "", "", "", "", "opaque", "", ""); } |
| | 381 | test { try parsePass("non-special:opaque ?hi", null, "non-special:opaque %20?hi", "null", "non-special:", "", "", "", "", "", "opaque %20", "?hi", ""); } |
| | 382 | test { try parsePass("non-special:opaque #hi", null, "non-special:opaque %20#hi", "null", "non-special:", "", "", "", "", "", "opaque %20", "", "#hi"); } |
| | 383 | test { try parsePass("non-special:opaque x?hi", null, "non-special:opaque x?hi", "null", "non-special:", "", "", "", "", "", "opaque x", "?hi", ""); } |
| | 384 | test { try parsePass("non-special:opaque x#hi", null, "non-special:opaque x#hi", "null", "non-special:", "", "", "", "", "", "opaque x", "", "#hi"); } |
| | 385 | test { try parsePass("non-special:opaque \t\t \t#hi", null, "non-special:opaque %20#hi", "null", "non-special:", "", "", "", "", "", "opaque %20", "", "#hi"); } |
| | 386 | test { try parsePass("non-special:opaque \t\t #hi", null, "non-special:opaque %20#hi", "null", "non-special:", "", "", "", "", "", "opaque %20", "", "#hi"); } |
| | 387 | test { try parsePass("non-special:opaque\t\t \r #hi", null, "non-special:opaque %20#hi", "null", "non-special:", "", "", "", "", "", "opaque %20", "", "#hi"); } |
| | 388 | test { try parsePass("https://x/\xfffd?\xfffd#\xfffd", null, "https://x/%EF%BF%BD?%EF%BF%BD#%EF%BF%BD", "https://x", "https:", "", "", "x", "x", "", "/%EF%BF%BD", "?%EF%BF%BD", "#%EF%BF%BD"); } |
| | 389 | test { try parsePass("https://fa\xdf.ExAmPlE/", null, "https://xn--fa-hia.example/", "https://xn--fa-hia.example", "https:", "", "", "xn--fa-hia.example", "xn--fa-hia.example", "", "/", "", ""); } |
| | 390 | test { try parsePass("sc://fa\xdf.ExAmPlE/", null, "sc://fa%C3%9F.ExAmPlE/", "null", "sc:", "", "", "fa%C3%9F.ExAmPlE", "fa%C3%9F.ExAmPlE", "", "/", "", ""); } |
| | 391 | test { try parsePass("http://./", null, "http://./", "http://.", "http:", "", "", ".", ".", "", "/", "", ""); } |
| | 392 | test { try parsePass("http://../", null, "http://../", "http://..", "http:", "", "", "..", "..", "", "/", "", ""); } |
| | 393 | test { try parsePass("h://.", null, "h://.", "null", "h:", "", "", ".", ".", "", "", "", ""); } |
| | 394 | test { try parsePass("http://host/?'", null, "http://host/?%27", "http://host", "http:", "", "", "host", "host", "", "/", "?%27", ""); } |
| | 395 | test { try parsePass("notspecial://host/?'", null, "notspecial://host/?'", "null", "notspecial:", "", "", "host", "host", "", "/", "?'", ""); } |
| | 396 | test { try parsePass("about:/../", null, "about:/", "null", "about:", "", "", "", "", "", "/", "", ""); } |
| | 397 | test { try parsePass("data:/../", null, "data:/", "null", "data:", "", "", "", "", "", "/", "", ""); } |
| | 398 | test { try parsePass("javascript:/../", null, "javascript:/", "null", "javascript:", "", "", "", "", "", "/", "", ""); } |
| | 399 | test { try parsePass("mailto:/../", null, "mailto:/", "null", "mailto:", "", "", "", "", "", "/", "", ""); } |
| | 400 | test { try parsePass("sc://\xf1.test/", null, "sc://%C3%B1.test/", "null", "sc:", "", "", "%C3%B1.test", "%C3%B1.test", "", "/", "", ""); } |
| | 401 | test { try parsePass("sc://%/", null, "sc://%/", "", "sc:", "", "", "%", "%", "", "/", "", ""); } |
| | 402 | test { try parsePass("sc:\\../", null, "sc:\\../", "null", "sc:", "", "", "", "", "", "\\../", "", ""); } |
| | 403 | test { try parsePass("sc::a@example.net", null, "sc::a@example.net", "null", "sc:", "", "", "", "", "", ":a@example.net", "", ""); } |
| | 404 | test { try parsePass("wow:%NBD", null, "wow:%NBD", "null", "wow:", "", "", "", "", "", "%NBD", "", ""); } |
| | 405 | test { try parsePass("wow:%1G", null, "wow:%1G", "null", "wow:", "", "", "", "", "", "%1G", "", ""); } |
| | 406 | test { try parsePass("wow:\xffff", null, "wow:%EF%BF%BF", "null", "wow:", "", "", "", "", "", "%EF%BF%BF", "", ""); } |
| | 407 | test { try parsePass("foo://ho\tst/", null, "foo://host/", "", "foo:", "", "", "host", "host", "", "/", "", ""); } |
| | 408 | test { try parsePass("foo://ho\nst/", null, "foo://host/", "", "foo:", "", "", "host", "host", "", "/", "", ""); } |
| | 409 | test { try parsePass("foo://ho\rst/", null, "foo://host/", "", "foo:", "", "", "host", "host", "", "/", "", ""); } |
| | 410 | test { try parsePass("http://ho\tst/", null, "http://host/", "", "http:", "", "", "host", "host", "", "/", "", ""); } |
| | 411 | test { try parsePass("http://ho\nst/", null, "http://host/", "", "http:", "", "", "host", "host", "", "/", "", ""); } |
| | 412 | test { try parsePass("http://ho\rst/", null, "http://host/", "", "http:", "", "", "host", "host", "", "/", "", ""); } |
| | 413 | test { try parsePass("http://!\"$&'()*+,-.;=_`{}~/", null, "http://!\"$&'()*+,-.;=_`{}~/", "http://!\"$&'()*+,-.;=_`{}~", "http:", "", "", "!\"$&'()*+,-.;=_`{}~", "!\"$&'()*+,-.;=_`{}~", "", "/", "", ""); } |
| | 414 | test { try parsePass("sc://\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x7f!\"$%&'()*+,-.;=_`{}~/", null, "sc://%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\"$%&'()*+,-.;=_`{}~/", "null", "sc:", "", "", "%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\"$%&'()*+,-.;=_`{}~", "%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\"$%&'()*+,-.;=_`{}~", "", "/", "", ""); } |
| | 415 | test { try parsePass("ftp://%e2%98%83", null, "ftp://xn--n3h/", "ftp://xn--n3h", "ftp:", "", "", "xn--n3h", "xn--n3h", "", "/", "", ""); } |
| | 416 | test { try parsePass("https://%e2%98%83", null, "https://xn--n3h/", "https://xn--n3h", "https:", "", "", "xn--n3h", "xn--n3h", "", "/", "", ""); } |
| | 417 | test { try parsePass("http://127.0.0.1:10100/relative_import.html", null, "http://127.0.0.1:10100/relative_import.html", "http://127.0.0.1:10100", "http:", "", "", "127.0.0.1:10100", "127.0.0.1", "10100", "/relative_import.html", "", ""); } |
| | 418 | test { try parsePass("http://facebook.com/?foo=%7B%22abc%22", null, "http://facebook.com/?foo=%7B%22abc%22", "http://facebook.com", "http:", "", "", "facebook.com", "facebook.com", "", "/", "?foo=%7B%22abc%22", ""); } |
| | 419 | test { try parsePass("https://localhost:3000/jqueryui@1.2.3", null, "https://localhost:3000/jqueryui@1.2.3", "https://localhost:3000", "https:", "", "", "localhost:3000", "localhost", "3000", "/jqueryui@1.2.3", "", ""); } |
| | 420 | test { try parsePass("h\tt\nt\rp://h\to\ns\rt:9\t0\n0\r0/p\ta\nt\rh?q\tu\ne\rry#f\tr\na\rg", null, "http://host:9000/path?query#frag", "http://host:9000", "http:", "", "", "host:9000", "host", "9000", "/path", "?query", "#frag"); } |
| | 421 | test { try parsePass("http://foo.bar/baz?qux#foo\x08bar", null, "http://foo.bar/baz?qux#foo%08bar", "http://foo.bar", "http:", "", "", "foo.bar", "foo.bar", "", "/baz", "?qux", "#foo%08bar"); } |
| | 422 | test { try parsePass("http://foo.bar/baz?qux#foo\"bar", null, "http://foo.bar/baz?qux#foo%22bar", "http://foo.bar", "http:", "", "", "foo.bar", "foo.bar", "", "/baz", "?qux", "#foo%22bar"); } |
| | 423 | test { try parsePass("http://foo.bar/baz?qux#foo<bar", null, "http://foo.bar/baz?qux#foo%3Cbar", "http://foo.bar", "http:", "", "", "foo.bar", "foo.bar", "", "/baz", "?qux", "#foo%3Cbar"); } |
| | 424 | test { try parsePass("http://foo.bar/baz?qux#foo>bar", null, "http://foo.bar/baz?qux#foo%3Ebar", "http://foo.bar", "http:", "", "", "foo.bar", "foo.bar", "", "/baz", "?qux", "#foo%3Ebar"); } |
| | 425 | test { try parsePass("http://foo.bar/baz?qux#foo`bar", null, "http://foo.bar/baz?qux#foo%60bar", "http://foo.bar", "http:", "", "", "foo.bar", "foo.bar", "", "/baz", "?qux", "#foo%60bar"); } |
| | 426 | test { try parsePass("https://0x.0x.0", null, "https://0.0.0.0/", "https://0.0.0.0", "https:", "", "", "0.0.0.0", "0.0.0.0", "", "/", "", ""); } |
| | 427 | test { try parsePass("file:///C%3A/", null, "file:///C%3A/", "", "file:", "", "", "", "", "", "/C%3A/", "", ""); } |
| | 428 | test { try parsePass("file:///C%7C/", null, "file:///C%7C/", "", "file:", "", "", "", "", "", "/C%7C/", "", ""); } |
| | 429 | test { try parsePass("asdf://%43%7C/", null, "asdf://%43%7C/", "null", "asdf:", "", "", "%43%7C", "%43%7C", "", "/", "", ""); } |
| | 430 | test { try parsePass("file:\\\\//", null, "file:////", "", "file:", "", "", "", "", "", "//", "", ""); } |
| | 431 | test { try parsePass("file:\\\\\\\\", null, "file:////", "", "file:", "", "", "", "", "", "//", "", ""); } |
| | 432 | test { try parsePass("file:\\\\\\\\?fox", null, "file:////?fox", "", "file:", "", "", "", "", "", "//", "?fox", ""); } |
| | 433 | test { try parsePass("file:\\\\\\\\#guppy", null, "file:////#guppy", "", "file:", "", "", "", "", "", "//", "", "#guppy"); } |
| | 434 | test { try parsePass("file://spider///", null, "file://spider///", "", "file:", "", "", "spider", "spider", "", "///", "", ""); } |
| | 435 | test { try parsePass("file:\\\\localhost//", null, "file:////", "", "file:", "", "", "", "", "", "//", "", ""); } |
| | 436 | test { try parsePass("file:///localhost//cat", null, "file:///localhost//cat", "", "file:", "", "", "", "", "", "/localhost//cat", "", ""); } |
| | 437 | test { try parsePass("file://\\/localhost//cat", null, "file:////localhost//cat", "", "file:", "", "", "", "", "", "//localhost//cat", "", ""); } |
| | 438 | test { try parsePass("file://localhost//a//../..//", null, "file://///", "", "file:", "", "", "", "", "", "///", "", ""); } |
| | 439 | test { try parsePass("file://example.net/C:/", null, "file://example.net/C:/", "", "file:", "", "", "example.net", "example.net", "", "/C:/", "", ""); } |
| | 440 | test { try parsePass("file://1.2.3.4/C:/", null, "file://1.2.3.4/C:/", "", "file:", "", "", "1.2.3.4", "1.2.3.4", "", "/C:/", "", ""); } |
| | 441 | test { try parsePass("file://[1::8]/C:/", null, "file://[1::8]/C:/", "", "file:", "", "", "[1::8]", "[1::8]", "", "/C:/", "", ""); } |
| | 442 | test { try parsePass("file:/C|/", null, "file:///C:/", "", "file:", "", "", "", "", "", "/C:/", "", ""); } |
| | 443 | test { try parsePass("file://C|/", null, "file:///C:/", "", "file:", "", "", "", "", "", "/C:/", "", ""); } |
| | 444 | test { try parsePass("file:", null, "file:///", "", "file:", "", "", "", "", "", "/", "", ""); } |
| | 445 | test { try parsePass("file:?q=v", null, "file:///?q=v", "", "file:", "", "", "", "", "", "/", "?q=v", ""); } |
| | 446 | test { try parsePass("file:#frag", null, "file:///#frag", "", "file:", "", "", "", "", "", "/", "", "#frag"); } |
| | 447 | test { try parsePass("file:///Y:", null, "file:///Y:", "", "file:", "", "", "", "", "", "/Y:", "", ""); } |
| | 448 | test { try parsePass("file:///Y:/", null, "file:///Y:/", "", "file:", "", "", "", "", "", "/Y:/", "", ""); } |
| | 449 | test { try parsePass("file:///./Y", null, "file:///Y", "", "file:", "", "", "", "", "", "/Y", "", ""); } |
| | 450 | test { try parsePass("file:///./Y:", null, "file:///Y:", "", "file:", "", "", "", "", "", "/Y:", "", ""); } |
| | 451 | test { try parsePass("file:///y:", null, "file:///y:", "", "file:", "", "", "", "", "", "/y:", "", ""); } |
| | 452 | test { try parsePass("file:///y:/", null, "file:///y:/", "", "file:", "", "", "", "", "", "/y:/", "", ""); } |
| | 453 | test { try parsePass("file:///./y", null, "file:///y", "", "file:", "", "", "", "", "", "/y", "", ""); } |
| | 454 | test { try parsePass("file:///./y:", null, "file:///y:", "", "file:", "", "", "", "", "", "/y:", "", ""); } |
| | 455 | test { try parsePass("file://localhost//a//../..//foo", null, "file://///foo", "", "file:", "", "", "", "", "", "///foo", "", ""); } |
| | 456 | test { try parsePass("file://localhost////foo", null, "file://////foo", "", "file:", "", "", "", "", "", "////foo", "", ""); } |
| | 457 | test { try parsePass("file:////foo", null, "file:////foo", "", "file:", "", "", "", "", "", "//foo", "", ""); } |
| | 458 | test { try parsePass("file:.//p", null, "file:////p", "", "file:", "", "", "", "", "", "//p", "", ""); } |
| | 459 | test { try parsePass("file:/.//p", null, "file:////p", "", "file:", "", "", "", "", "", "//p", "", ""); } |
| | 460 | test { try parsePass("sc://\xf1", null, "sc://%C3%B1", "null", "sc:", "", "", "%C3%B1", "%C3%B1", "", "", "", ""); } |
| | 461 | test { try parsePass("sc://\xf1?x", null, "sc://%C3%B1?x", "null", "sc:", "", "", "%C3%B1", "%C3%B1", "", "", "?x", ""); } |
| | 462 | test { try parsePass("sc://\xf1#x", null, "sc://%C3%B1#x", "null", "sc:", "", "", "%C3%B1", "%C3%B1", "", "", "", "#x"); } |
| | 463 | test { try parsePass("sc://?", null, "sc://?", "", "sc:", "", "", "", "", "", "", "", ""); } |
| | 464 | test { try parsePass("sc://#", null, "sc://#", "", "sc:", "", "", "", "", "", "", "", ""); } |
| | 465 | test { try parsePass("tftp://foobar.com/someconfig;mode=netascii", null, "tftp://foobar.com/someconfig;mode=netascii", "null", "tftp:", "", "", "foobar.com", "foobar.com", "", "/someconfig;mode=netascii", "", ""); } |
| | 466 | test { try parsePass("telnet://user:pass@foobar.com:23/", null, "telnet://user:pass@foobar.com:23/", "null", "telnet:", "user", "pass", "foobar.com:23", "foobar.com", "23", "/", "", ""); } |
| | 467 | test { try parsePass("ut2004://10.10.10.10:7777/Index.ut2", null, "ut2004://10.10.10.10:7777/Index.ut2", "null", "ut2004:", "", "", "10.10.10.10:7777", "10.10.10.10", "7777", "/Index.ut2", "", ""); } |
| | 468 | test { try parsePass("redis://foo:bar@somehost:6379/0?baz=bam&qux=baz", null, "redis://foo:bar@somehost:6379/0?baz=bam&qux=baz", "null", "redis:", "foo", "bar", "somehost:6379", "somehost", "6379", "/0", "?baz=bam&qux=baz", ""); } |
| | 469 | test { try parsePass("rsync://foo@host:911/sup", null, "rsync://foo@host:911/sup", "null", "rsync:", "foo", "", "host:911", "host", "911", "/sup", "", ""); } |
| | 470 | test { try parsePass("git://github.com/foo/bar.git", null, "git://github.com/foo/bar.git", "null", "git:", "", "", "github.com", "github.com", "", "/foo/bar.git", "", ""); } |
| | 471 | test { try parsePass("irc://myserver.com:6999/channel?passwd", null, "irc://myserver.com:6999/channel?passwd", "null", "irc:", "", "", "myserver.com:6999", "myserver.com", "6999", "/channel", "?passwd", ""); } |
| | 472 | test { try parsePass("dns://fw.example.org:9999/foo.bar.org?type=TXT", null, "dns://fw.example.org:9999/foo.bar.org?type=TXT", "null", "dns:", "", "", "fw.example.org:9999", "fw.example.org", "9999", "/foo.bar.org", "?type=TXT", ""); } |
| | 473 | test { try parsePass("ldap://localhost:389/ou=People,o=JNDITutorial", null, "ldap://localhost:389/ou=People,o=JNDITutorial", "null", "ldap:", "", "", "localhost:389", "localhost", "389", "/ou=People,o=JNDITutorial", "", ""); } |
| | 474 | test { try parsePass("git+https://github.com/foo/bar", null, "git+https://github.com/foo/bar", "null", "git+https:", "", "", "github.com", "github.com", "", "/foo/bar", "", ""); } |
| | 475 | test { try parsePass("urn:ietf:rfc:2648", null, "urn:ietf:rfc:2648", "null", "urn:", "", "", "", "", "", "ietf:rfc:2648", "", ""); } |
| | 476 | test { try parsePass("tag:joe@example.org,2001:foo/bar", null, "tag:joe@example.org,2001:foo/bar", "null", "tag:", "", "", "", "", "", "joe@example.org,2001:foo/bar", "", ""); } |
| | 477 | test { try parsePass("non-spec:/.//", null, "non-spec:/.//", "", "non-spec:", "", "", "", "", "", "//", "", ""); } |
| | 478 | test { try parsePass("non-spec:/..//", null, "non-spec:/.//", "", "non-spec:", "", "", "", "", "", "//", "", ""); } |
| | 479 | test { try parsePass("non-spec:/a/..//", null, "non-spec:/.//", "", "non-spec:", "", "", "", "", "", "//", "", ""); } |
| | 480 | test { try parsePass("non-spec:/.//path", null, "non-spec:/.//path", "", "non-spec:", "", "", "", "", "", "//path", "", ""); } |
| | 481 | test { try parsePass("non-spec:/..//path", null, "non-spec:/.//path", "", "non-spec:", "", "", "", "", "", "//path", "", ""); } |
| | 482 | test { try parsePass("non-spec:/a/..//path", null, "non-spec:/.//path", "", "non-spec:", "", "", "", "", "", "//path", "", ""); } |
| | 483 | test { try parsePass("non-special://%E2%80%A0/", null, "non-special://%E2%80%A0/", "", "non-special:", "", "", "%E2%80%A0", "%E2%80%A0", "", "/", "", ""); } |
| | 484 | test { try parsePass("non-special://H%4fSt/path", null, "non-special://H%4fSt/path", "", "non-special:", "", "", "H%4fSt", "H%4fSt", "", "/path", "", ""); } |
| | 485 | test { try parsePass("non-special://[1:2:0:0:5:0:0:0]/", null, "non-special://[1:2:0:0:5::]/", "", "non-special:", "", "", "[1:2:0:0:5::]", "[1:2:0:0:5::]", "", "/", "", ""); } |
| | 486 | test { try parsePass("non-special://[1:2:0:0:0:0:0:3]/", null, "non-special://[1:2::3]/", "", "non-special:", "", "", "[1:2::3]", "[1:2::3]", "", "/", "", ""); } |
| | 487 | test { try parsePass("non-special://[1:2::3]:80/", null, "non-special://[1:2::3]:80/", "", "non-special:", "", "", "[1:2::3]:80", "[1:2::3]", "80", "/", "", ""); } |
| | 488 | test { try parsePass("blob:https://example.com:443/", null, "blob:https://example.com:443/", "https://example.com", "blob:", "", "", "", "", "", "https://example.com:443/", "", ""); } |
| | 489 | test { try parsePass("blob:http://example.org:88/", null, "blob:http://example.org:88/", "http://example.org:88", "blob:", "", "", "", "", "", "http://example.org:88/", "", ""); } |
| | 490 | test { try parsePass("blob:d3958f5c-0777-0845-9dcf-2cb28783acaf", null, "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf", "null", "blob:", "", "", "", "", "", "d3958f5c-0777-0845-9dcf-2cb28783acaf", "", ""); } |
| | 491 | test { try parsePass("blob:", null, "blob:", "null", "blob:", "", "", "", "", "", "", "", ""); } |
| | 492 | test { try parsePass("blob:blob:", null, "blob:blob:", "null", "blob:", "", "", "", "", "", "blob:", "", ""); } |
| | 493 | test { try parsePass("blob:blob:https://example.org/", null, "blob:blob:https://example.org/", "null", "blob:", "", "", "", "", "", "blob:https://example.org/", "", ""); } |
| | 494 | test { try parsePass("blob:about:blank", null, "blob:about:blank", "null", "blob:", "", "", "", "", "", "about:blank", "", ""); } |
| | 495 | test { try parsePass("blob:file://host/path", null, "blob:file://host/path", "", "blob:", "", "", "", "", "", "file://host/path", "", ""); } |
| | 496 | test { try parsePass("blob:ftp://host/path", null, "blob:ftp://host/path", "null", "blob:", "", "", "", "", "", "ftp://host/path", "", ""); } |
| | 497 | test { try parsePass("blob:ws://example.org/", null, "blob:ws://example.org/", "null", "blob:", "", "", "", "", "", "ws://example.org/", "", ""); } |
| | 498 | test { try parsePass("blob:wss://example.org/", null, "blob:wss://example.org/", "null", "blob:", "", "", "", "", "", "wss://example.org/", "", ""); } |
| | 499 | test { try parsePass("blob:http%3a//example.org/", null, "blob:http%3a//example.org/", "null", "blob:", "", "", "", "", "", "http%3a//example.org/", "", ""); } |
| | 500 | test { try parsePass("http://0x7f.0.0.0x7g", null, "http://0x7f.0.0.0x7g/", "", "http:", "", "", "0x7f.0.0.0x7g", "0x7f.0.0.0x7g", "", "/", "", ""); } |
| | 501 | test { try parsePass("http://0X7F.0.0.0X7G", null, "http://0x7f.0.0.0x7g/", "", "http:", "", "", "0x7f.0.0.0x7g", "0x7f.0.0.0x7g", "", "/", "", ""); } |
| | 502 | test { try parsePass("http://[0:1:0:1:0:1:0:1]", null, "http://[0:1:0:1:0:1:0:1]/", "", "http:", "", "", "[0:1:0:1:0:1:0:1]", "[0:1:0:1:0:1:0:1]", "", "/", "", ""); } |
| | 503 | test { try parsePass("http://[1:0:1:0:1:0:1:0]", null, "http://[1:0:1:0:1:0:1:0]/", "", "http:", "", "", "[1:0:1:0:1:0:1:0]", "[1:0:1:0:1:0:1:0]", "", "/", "", ""); } |
| | 504 | test { try parsePass("http://example.org/test?\"", null, "http://example.org/test?%22", "", "http:", "", "", "example.org", "example.org", "", "/test", "?%22", ""); } |
| | 505 | test { try parsePass("http://example.org/test?#", null, "http://example.org/test?#", "", "http:", "", "", "example.org", "example.org", "", "/test", "", ""); } |
| | 506 | test { try parsePass("http://example.org/test?<", null, "http://example.org/test?%3C", "", "http:", "", "", "example.org", "example.org", "", "/test", "?%3C", ""); } |
| | 507 | test { try parsePass("http://example.org/test?>", null, "http://example.org/test?%3E", "", "http:", "", "", "example.org", "example.org", "", "/test", "?%3E", ""); } |
| | 508 | test { try parsePass("http://example.org/test?\x2323", null, "http://example.org/test?%E2%8C%A3", "", "http:", "", "", "example.org", "example.org", "", "/test", "?%E2%8C%A3", ""); } |
| | 509 | test { try parsePass("http://example.org/test?%23%23", null, "http://example.org/test?%23%23", "", "http:", "", "", "example.org", "example.org", "", "/test", "?%23%23", ""); } |
| | 510 | test { try parsePass("http://example.org/test?%GH", null, "http://example.org/test?%GH", "", "http:", "", "", "example.org", "example.org", "", "/test", "?%GH", ""); } |
| | 511 | test { try parsePass("http://example.org/test?a#%EF", null, "http://example.org/test?a#%EF", "", "http:", "", "", "example.org", "example.org", "", "/test", "?a", "#%EF"); } |
| | 512 | test { try parsePass("http://example.org/test?a#%GH", null, "http://example.org/test?a#%GH", "", "http:", "", "", "example.org", "example.org", "", "/test", "?a", "#%GH"); } |
| | 513 | test { try parsePass("http://example.org/test?a#b\x00c", null, "http://example.org/test?a#b%00c", "", "http:", "", "", "example.org", "example.org", "", "/test", "?a", "#b%00c"); } |
| | 514 | test { try parsePass("non-spec://example.org/test?a#b\x00c", null, "non-spec://example.org/test?a#b%00c", "", "non-spec:", "", "", "example.org", "example.org", "", "/test", "?a", "#b%00c"); } |
| | 515 | test { try parsePass("non-spec:/test?a#b\x00c", null, "non-spec:/test?a#b%00c", "", "non-spec:", "", "", "", "", "", "/test", "?a", "#b%00c"); } |
| | 516 | test { try parsePass("file://a\xadb/p", null, "file://ab/p", "", "file:", "", "", "ab", "ab", "", "/p", "", ""); } |
| | 517 | test { try parsePass("file://a%C2%ADb/p", null, "file://ab/p", "", "file:", "", "", "ab", "ab", "", "/p", "", ""); } |
| | 518 | test { try parsePass("file://loC\xd835\xdc00\xd835\xdc0b\xd835\xdc07\xd835\xdc28\xd835\xdc2c\xd835\xdc2d/usr/bin", null, "file:///usr/bin", "", "file:", "", "", "", "", "", "/usr/bin", "", ""); } |
| | 519 | test { try parsePass("non-special:cannot-be-a-base-url-\x00\x01\x1f\x1e~\x7f\x80", null, "non-special:cannot-be-a-base-url-%00%01%1F%1E~%7F%C2%80", "null", "non-special:", "", "", "", "", "", "cannot-be-a-base-url-%00%01%1F%1E~%7F%C2%80", "", ""); } |
| | 520 | test { try parsePass("non-special:cannot-be-a-base-url-!\"$%&'()*+,-.;<=>@[\\]^_`{|}~@/", null, "non-special:cannot-be-a-base-url-!\"$%&'()*+,-.;<=>@[\\]^_`{|}~@/", "null", "non-special:", "", "", "", "", "", "cannot-be-a-base-url-!\"$%&'()*+,-.;<=>@[\\]^_`{|}~@/", "", ""); } |
| | 521 | test { try parsePass("https://www.example.com/path{\x7fpath.html?query'\x7f=query#fragment<\x7ffragment", null, "https://www.example.com/path%7B%7Fpath.html?query%27%7F=query#fragment%3C%7Ffragment", "https://www.example.com", "https:", "", "", "www.example.com", "www.example.com", "", "/path%7B%7Fpath.html", "?query%27%7F=query", "#fragment%3C%7Ffragment"); } |
| | 522 | test { try parsePass("foo:// !\"$%&'()*+,-.;<=>@[\\]^_`{|}~@host/", null, "foo://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/", "null", "foo:", "%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~", "", "host", "host", "", "/", "", ""); } |
| | 523 | test { try parsePass("wss:// !\"$%&'()*+,-.;<=>@[]^_`{|}~@host/", null, "wss://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/", "wss://host", "wss:", "%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~", "", "host", "host", "", "/", "", ""); } |
| | 524 | test { try parsePass("foo://joe: !\"$%&'()*+,-.:;<=>@[\\]^_`{|}~@host/", null, "foo://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/", "null", "foo:", "joe", "%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~", "host", "host", "", "/", "", ""); } |
| | 525 | test { try parsePass("wss://joe: !\"$%&'()*+,-.:;<=>@[]^_`{|}~@host/", null, "wss://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/", "wss://host", "wss:", "joe", "%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~", "host", "host", "", "/", "", ""); } |
| | 526 | test { try parsePass("foo://!\"$%&'()*+,-.;=_`{}~/", null, "foo://!\"$%&'()*+,-.;=_`{}~/", "null", "foo:", "", "", "!\"$%&'()*+,-.;=_`{}~", "!\"$%&'()*+,-.;=_`{}~", "", "/", "", ""); } |
| | 527 | test { try parsePass("wss://!\"$&'()*+,-.;=_`{}~/", null, "wss://!\"$&'()*+,-.;=_`{}~/", "wss://!\"$&'()*+,-.;=_`{}~", "wss:", "", "", "!\"$&'()*+,-.;=_`{}~", "!\"$&'()*+,-.;=_`{}~", "", "/", "", ""); } |
| | 528 | test { try parsePass("foo://host/ !\"$%&'()*+,-./:;<=>@[\\]^_`{|}~", null, "foo://host/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]%5E_%60%7B|%7D~", "null", "foo:", "", "", "host", "host", "", "/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]%5E_%60%7B|%7D~", "", ""); } |
| | 529 | test { try parsePass("wss://host/ !\"$%&'()*+,-./:;<=>@[\\]^_`{|}~", null, "wss://host/%20!%22$%&'()*+,-./:;%3C=%3E@[/]%5E_%60%7B|%7D~", "wss://host", "wss:", "", "", "host", "host", "", "/%20!%22$%&'()*+,-./:;%3C=%3E@[/]%5E_%60%7B|%7D~", "", ""); } |
| | 530 | test { try parsePass("foo://host/dir/? !\"$%&'()*+,-./:;<=>?@[\\]^_`{|}~", null, "foo://host/dir/?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\]^_`{|}~", "null", "foo:", "", "", "host", "host", "", "/dir/", "?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\]^_`{|}~", ""); } |
| | 531 | test { try parsePass("wss://host/dir/? !\"$%&'()*+,-./:;<=>?@[\\]^_`{|}~", null, "wss://host/dir/?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\]^_`{|}~", "wss://host", "wss:", "", "", "host", "host", "", "/dir/", "?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\]^_`{|}~", ""); } |
| | 532 | test { try parsePass("foo://host/dir/# !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", null, "foo://host/dir/#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~", "null", "foo:", "", "", "host", "host", "", "/dir/", "", "#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~"); } |
| | 533 | test { try parsePass("wss://host/dir/# !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", null, "wss://host/dir/#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~", "wss://host", "wss:", "", "", "host", "host", "", "/dir/", "", "#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~"); } |
| | 534 | test { try parsePass("http://foo.09..", null, "http://foo.09../", "", "http:", "", "", "foo.09..", "foo.09..", "", "/", "", ""); } |
| | 535 | test { try parsePass("https://x/\x00y", null, "https://x/%00y", "", "https:", "", "", "x", "x", "", "/%00y", "", ""); } |
| | 536 | test { try parsePass("https://x/?\x00y", null, "https://x/?%00y", "", "https:", "", "", "x", "x", "", "/", "?%00y", ""); } |
| | 537 | test { try parsePass("https://x/?#\x00y", null, "https://x/?#%00y", "", "https:", "", "", "x", "x", "", "/", "", "#%00y"); } |
| | 538 | test { try parsePass("https://x/\xffffy", null, "https://x/%EF%BF%BFy", "", "https:", "", "", "x", "x", "", "/%EF%BF%BFy", "", ""); } |
| | 539 | test { try parsePass("https://x/?\xffffy", null, "https://x/?%EF%BF%BFy", "", "https:", "", "", "x", "x", "", "/", "?%EF%BF%BFy", ""); } |
| | 540 | test { try parsePass("https://x/?#\xffffy", null, "https://x/?#%EF%BF%BFy", "", "https:", "", "", "x", "x", "", "/", "", "#%EF%BF%BFy"); } |
| | 541 | test { try parsePass("non-special:\x00y", null, "non-special:%00y", "", "non-special:", "", "", "", "", "", "%00y", "", ""); } |
| | 542 | test { try parsePass("non-special:x/\x00y", null, "non-special:x/%00y", "", "non-special:", "", "", "", "", "", "x/%00y", "", ""); } |
| | 543 | test { try parsePass("non-special:x/?\x00y", null, "non-special:x/?%00y", "", "non-special:", "", "", "", "", "", "x/", "?%00y", ""); } |
| | 544 | test { try parsePass("non-special:x/?#\x00y", null, "non-special:x/?#%00y", "", "non-special:", "", "", "", "", "", "x/", "", "#%00y"); } |
| | 545 | test { try parsePass("non-special:\xffffy", null, "non-special:%EF%BF%BFy", "", "non-special:", "", "", "", "", "", "%EF%BF%BFy", "", ""); } |
| | 546 | test { try parsePass("non-special:x/\xffffy", null, "non-special:x/%EF%BF%BFy", "", "non-special:", "", "", "", "", "", "x/%EF%BF%BFy", "", ""); } |
| | 547 | test { try parsePass("non-special:x/?\xffffy", null, "non-special:x/?%EF%BF%BFy", "", "non-special:", "", "", "", "", "", "x/", "?%EF%BF%BFy", ""); } |
| | 548 | test { try parsePass("non-special:x/?#\xffffy", null, "non-special:x/?#%EF%BF%BFy", "", "non-special:", "", "", "", "", "", "x/", "", "#%EF%BF%BFy"); } |
| | 549 | test { try parsePass("https://example.com/\"quoted\"", null, "https://example.com/%22quoted%22", "https://example.com", "https:", "", "", "example.com", "example.com", "", "/%22quoted%22", "", ""); } |
| | 550 | test { try parsePass("https://a%C2%ADb/", null, "https://ab/", "https://ab", "https:", "", "", "ab", "ab", "", "/", "", ""); } |
| | 551 | test { try parsePass("data://example.com:8080/pathname?search#hash", null, "data://example.com:8080/pathname?search#hash", "null", "data:", "", "", "example.com:8080", "example.com", "8080", "/pathname", "?search", "#hash"); } |
| | 552 | test { try parsePass("data:///test", null, "data:///test", "null", "data:", "", "", "", "", "", "/test", "", ""); } |
| | 553 | test { try parsePass("data://test/a/../b", null, "data://test/b", "null", "data:", "", "", "test", "test", "", "/b", "", ""); } |
| | 554 | test { try parsePass("javascript://example.com:8080/pathname?search#hash", null, "javascript://example.com:8080/pathname?search#hash", "null", "javascript:", "", "", "example.com:8080", "example.com", "8080", "/pathname", "?search", "#hash"); } |
| | 555 | test { try parsePass("javascript:///test", null, "javascript:///test", "null", "javascript:", "", "", "", "", "", "/test", "", ""); } |
| | 556 | test { try parsePass("javascript://test/a/../b", null, "javascript://test/b", "null", "javascript:", "", "", "test", "test", "", "/b", "", ""); } |
| | 557 | test { try parsePass("mailto://example.com:8080/pathname?search#hash", null, "mailto://example.com:8080/pathname?search#hash", "null", "mailto:", "", "", "example.com:8080", "example.com", "8080", "/pathname", "?search", "#hash"); } |
| | 558 | test { try parsePass("mailto:///test", null, "mailto:///test", "null", "mailto:", "", "", "", "", "", "/test", "", ""); } |
| | 559 | test { try parsePass("mailto://test/a/../b", null, "mailto://test/b", "null", "mailto:", "", "", "test", "test", "", "/b", "", ""); } |
| | 560 | test { try parsePass("intent://example.com:8080/pathname?search#hash", null, "intent://example.com:8080/pathname?search#hash", "null", "intent:", "", "", "example.com:8080", "example.com", "8080", "/pathname", "?search", "#hash"); } |
| | 561 | test { try parsePass("intent:///test", null, "intent:///test", "null", "intent:", "", "", "", "", "", "/test", "", ""); } |
| | 562 | test { try parsePass("intent://test/a/../b", null, "intent://test/b", "null", "intent:", "", "", "test", "test", "", "/b", "", ""); } |
| | 563 | test { try parsePass("urn://example.com:8080/pathname?search#hash", null, "urn://example.com:8080/pathname?search#hash", "null", "urn:", "", "", "example.com:8080", "example.com", "8080", "/pathname", "?search", "#hash"); } |
| | 564 | test { try parsePass("urn:///test", null, "urn:///test", "null", "urn:", "", "", "", "", "", "/test", "", ""); } |
| | 565 | test { try parsePass("urn://test/a/../b", null, "urn://test/b", "null", "urn:", "", "", "test", "test", "", "/b", "", ""); } |
| | 566 | test { try parsePass("turn://example.com:8080/pathname?search#hash", null, "turn://example.com:8080/pathname?search#hash", "null", "turn:", "", "", "example.com:8080", "example.com", "8080", "/pathname", "?search", "#hash"); } |
| | 567 | test { try parsePass("turn:///test", null, "turn:///test", "null", "turn:", "", "", "", "", "", "/test", "", ""); } |
| | 568 | test { try parsePass("turn://test/a/../b", null, "turn://test/b", "null", "turn:", "", "", "test", "test", "", "/b", "", ""); } |
| | 569 | test { try parsePass("stun://example.com:8080/pathname?search#hash", null, "stun://example.com:8080/pathname?search#hash", "null", "stun:", "", "", "example.com:8080", "example.com", "8080", "/pathname", "?search", "#hash"); } |
| | 570 | test { try parsePass("stun:///test", null, "stun:///test", "null", "stun:", "", "", "", "", "", "/test", "", ""); } |
| | 571 | test { try parsePass("stun://test/a/../b", null, "stun://test/b", "null", "stun:", "", "", "test", "test", "", "/b", "", ""); } |
| | 572 | test { try parsePass("w://x:0", null, "w://x:0", "null", "w:", "", "", "x:0", "x", "0", "", "", ""); } |
| | 573 | test { try parsePass("west://x:0", null, "west://x:0", "null", "west:", "", "", "x:0", "x", "0", "", "", ""); } |
| | 574 | test { try parsePass("android://x:0/a", null, "android://x:0/a", "null", "android:", "", "", "x:0", "x", "0", "/a", "", ""); } |
| | 575 | test { try parsePass("drivefs://x:0/a", null, "drivefs://x:0/a", "null", "drivefs:", "", "", "x:0", "x", "0", "/a", "", ""); } |
| | 576 | test { try parsePass("chromeos-steam://x:0/a", null, "chromeos-steam://x:0/a", "null", "chromeos-steam:", "", "", "x:0", "x", "0", "/a", "", ""); } |
| | 577 | test { try parsePass("steam://x:0/a", null, "steam://x:0/a", "null", "steam:", "", "", "x:0", "x", "0", "/a", "", ""); } |
| | 578 | test { try parsePass("materialized-view://x:0/a", null, "materialized-view://x:0/a", "null", "materialized-view:", "", "", "x:0", "x", "0", "/a", "", ""); } |
| | 579 | test { try parsePass("android-app://x:0", null, "android-app://x:0", "null", "android-app:", "", "", "x:0", "x", "0", "", "", ""); } |
| | 580 | test { try parsePass("chrome-distiller://x:0", null, "chrome-distiller://x:0", "null", "chrome-distiller:", "", "", "x:0", "x", "0", "", "", ""); } |
| | 581 | test { try parsePass("chrome-extension://x:0", null, "chrome-extension://x:0", "null", "chrome-extension:", "", "", "x:0", "x", "0", "", "", ""); } |
| | 582 | test { try parsePass("chrome-native://x:0", null, "chrome-native://x:0", "null", "chrome-native:", "", "", "x:0", "x", "0", "", "", ""); } |
| | 583 | test { try parsePass("chrome-resource://x:0", null, "chrome-resource://x:0", "null", "chrome-resource:", "", "", "x:0", "x", "0", "", "", ""); } |
| | 584 | test { try parsePass("chrome-search://x:0", null, "chrome-search://x:0", "null", "chrome-search:", "", "", "x:0", "x", "0", "", "", ""); } |
| | 585 | test { try parsePass("fuchsia-dir://x:0", null, "fuchsia-dir://x:0", "null", "fuchsia-dir:", "", "", "x:0", "x", "0", "", "", ""); } |
| | 586 | test { try parsePass("isolated-app://x:0", null, "isolated-app://x:0", "null", "isolated-app:", "", "", "x:0", "x", "0", "", "", ""); } |
| | 587 | test { try parsePass("non-special:\\\\opaque", null, "non-special:\\\\opaque", "null", "non-special:", "", "", "", "", "", "\\\\opaque", "", ""); } |
| | 588 | test { try parsePass("non-special:\\\\opaque/path", null, "non-special:\\\\opaque/path", "null", "non-special:", "", "", "", "", "", "\\\\opaque/path", "", ""); } |
| | 589 | test { try parsePass("non-special:\\\\opaque\\path", null, "non-special:\\\\opaque\\path", "null", "non-special:", "", "", "", "", "", "\\\\opaque\\path", "", ""); } |
| | 590 | test { try parsePass("non-special:\\/opaque", null, "non-special:\\/opaque", "null", "non-special:", "", "", "", "", "", "\\/opaque", "", ""); } |
| | 591 | test { try parsePass("non-special:/\\path", null, "non-special:/\\path", "null", "non-special:", "", "", "", "", "", "/\\path", "", ""); } |
| | 592 | test { try parsePass("non-special://host/a\\b", null, "non-special://host/a\\b", "null", "non-special:", "", "", "host", "host", "", "/a\\b", "", ""); } |
| 265 | | 593 | |
| 266 | | 594 | |
| 267 | | 595 | |