Bug 1857386 [wpt PR 42383] - Update wpt metadata, a=testonly
[gecko.git] / netwerk / test / gtest / urltestdata.json
blob41cf6725b3863b6ae4fdc39923b7e018f5553348
2   "This file is based on testing/web-platform/tests/url/resources/urltestdata.json (with failing tests removed)",
3   {
4     "input": "http://example\t.\norg",
5     "base": "http://example.org/foo/bar",
6     "href": "http://example.org/",
7     "origin": "http://example.org",
8     "protocol": "http:",
9     "username": "",
10     "password": "",
11     "host": "example.org",
12     "hostname": "example.org",
13     "port": "",
14     "pathname": "/",
15     "search": "",
16     "hash": ""
17   },
18   {
19     "input": "http://user:pass@foo:21/bar;par?b#c",
20     "base": "http://example.org/foo/bar",
21     "href": "http://user:pass@foo:21/bar;par?b#c",
22     "origin": "http://foo:21",
23     "protocol": "http:",
24     "username": "user",
25     "password": "pass",
26     "host": "foo:21",
27     "hostname": "foo",
28     "port": "21",
29     "pathname": "/bar;par",
30     "search": "?b",
31     "hash": "#c"
32   },
33   {
34     "input": "https://test:@test",
35     "base": null,
36     "href": "https://test@test/",
37     "origin": "https://test",
38     "protocol": "https:",
39     "username": "test",
40     "password": "",
41     "host": "test",
42     "hostname": "test",
43     "port": "",
44     "pathname": "/",
45     "search": "",
46     "hash": ""
47   },
48   {
49     "input": "https://:@test",
50     "base": null,
51     "href": "https://test/",
52     "origin": "https://test",
53     "protocol": "https:",
54     "username": "",
55     "password": "",
56     "host": "test",
57     "hostname": "test",
58     "port": "",
59     "pathname": "/",
60     "search": "",
61     "hash": ""
62   },
63   {
64     "input": "non-special://test:@test/x",
65     "base": null,
66     "href": "non-special://test@test/x",
67     "origin": "null",
68     "protocol": "non-special:",
69     "username": "test",
70     "password": "",
71     "host": "test",
72     "hostname": "test",
73     "port": "",
74     "pathname": "/x",
75     "search": "",
76     "hash": ""
77   },
78   {
79     "input": "non-special://:@test/x",
80     "base": null,
81     "href": "non-special://test/x",
82     "origin": "null",
83     "protocol": "non-special:",
84     "username": "",
85     "password": "",
86     "host": "test",
87     "hostname": "test",
88     "port": "",
89     "pathname": "/x",
90     "search": "",
91     "hash": ""
92   },
93   {
94     "input": "http:foo.com",
95     "base": "http://example.org/foo/bar",
96     "href": "http://example.org/foo/foo.com",
97     "origin": "http://example.org",
98     "protocol": "http:",
99     "username": "",
100     "password": "",
101     "host": "example.org",
102     "hostname": "example.org",
103     "port": "",
104     "pathname": "/foo/foo.com",
105     "search": "",
106     "hash": ""
107   },
108   {
109     "input": "\t   :foo.com   \n",
110     "base": "http://example.org/foo/bar",
111     "href": "http://example.org/foo/:foo.com",
112     "origin": "http://example.org",
113     "protocol": "http:",
114     "username": "",
115     "password": "",
116     "host": "example.org",
117     "hostname": "example.org",
118     "port": "",
119     "pathname": "/foo/:foo.com",
120     "search": "",
121     "hash": ""
122   },
123   {
124     "input": " foo.com  ",
125     "base": "http://example.org/foo/bar",
126     "href": "http://example.org/foo/foo.com",
127     "origin": "http://example.org",
128     "protocol": "http:",
129     "username": "",
130     "password": "",
131     "host": "example.org",
132     "hostname": "example.org",
133     "port": "",
134     "pathname": "/foo/foo.com",
135     "search": "",
136     "hash": ""
137   },
138   {
139     "input": "a:\t foo.com",
140     "base": "http://example.org/foo/bar",
141     "href": "a: foo.com",
142     "origin": "null",
143     "protocol": "a:",
144     "username": "",
145     "password": "",
146     "host": "",
147     "hostname": "",
148     "port": "",
149     "pathname": " foo.com",
150     "search": "",
151     "hash": ""
152   },
153   {
154     "input": "http://f:21/ b ? d # e ",
155     "base": "http://example.org/foo/bar",
156     "href": "http://f:21/%20b%20?%20d%20#%20e",
157     "origin": "http://f:21",
158     "protocol": "http:",
159     "username": "",
160     "password": "",
161     "host": "f:21",
162     "hostname": "f",
163     "port": "21",
164     "pathname": "/%20b%20",
165     "search": "?%20d%20",
166     "hash": "#%20e"
167   },
168   {
169     "input": "lolscheme:x x#x x",
170     "base": null,
171     "href": "lolscheme:x x#x%20x",
172     "protocol": "lolscheme:",
173     "username": "",
174     "password": "",
175     "host": "",
176     "hostname": "",
177     "port": "",
178     "pathname": "x x",
179     "search": "",
180     "hash": "#x%20x"
181   },
182   {
183     "input": "http://f:/c",
184     "base": "http://example.org/foo/bar",
185     "href": "http://f/c",
186     "origin": "http://f",
187     "protocol": "http:",
188     "username": "",
189     "password": "",
190     "host": "f",
191     "hostname": "f",
192     "port": "",
193     "pathname": "/c",
194     "search": "",
195     "hash": ""
196   },
197   {
198     "input": "http://f:0/c",
199     "base": "http://example.org/foo/bar",
200     "href": "http://f:0/c",
201     "origin": "http://f:0",
202     "protocol": "http:",
203     "username": "",
204     "password": "",
205     "host": "f:0",
206     "hostname": "f",
207     "port": "0",
208     "pathname": "/c",
209     "search": "",
210     "hash": ""
211   },
212   {
213     "input": "http://f:00000000000000/c",
214     "base": "http://example.org/foo/bar",
215     "href": "http://f:0/c",
216     "origin": "http://f:0",
217     "protocol": "http:",
218     "username": "",
219     "password": "",
220     "host": "f:0",
221     "hostname": "f",
222     "port": "0",
223     "pathname": "/c",
224     "search": "",
225     "hash": ""
226   },
227   {
228     "input": "http://f:00000000000000000000080/c",
229     "base": "http://example.org/foo/bar",
230     "href": "http://f/c",
231     "origin": "http://f",
232     "protocol": "http:",
233     "username": "",
234     "password": "",
235     "host": "f",
236     "hostname": "f",
237     "port": "",
238     "pathname": "/c",
239     "search": "",
240     "hash": ""
241   },
242   {
243     "input": "http://f:b/c",
244     "base": "http://example.org/foo/bar",
245     "failure": true
246   },
247   {
248     "input": "http://f: /c",
249     "base": "http://example.org/foo/bar",
250     "failure": true
251   },
252   {
253     "input": "http://f:\n/c",
254     "base": "http://example.org/foo/bar",
255     "href": "http://f/c",
256     "origin": "http://f",
257     "protocol": "http:",
258     "username": "",
259     "password": "",
260     "host": "f",
261     "hostname": "f",
262     "port": "",
263     "pathname": "/c",
264     "search": "",
265     "hash": ""
266   },
267   {
268     "input": "http://f:fifty-two/c",
269     "base": "http://example.org/foo/bar",
270     "failure": true
271   },
272   {
273     "input": "http://f:999999/c",
274     "base": "http://example.org/foo/bar",
275     "failure": true
276   },
277   {
278     "input": "non-special://f:999999/c",
279     "base": "http://example.org/foo/bar",
280     "failure": true
281   },
282   {
283     "input": "http://f: 21 / b ? d # e ",
284     "base": "http://example.org/foo/bar",
285     "failure": true
286   },
287   {
288     "input": "",
289     "base": "http://example.org/foo/bar",
290     "href": "http://example.org/foo/bar",
291     "origin": "http://example.org",
292     "protocol": "http:",
293     "username": "",
294     "password": "",
295     "host": "example.org",
296     "hostname": "example.org",
297     "port": "",
298     "pathname": "/foo/bar",
299     "search": "",
300     "hash": ""
301   },
302   {
303     "input": "  \t",
304     "base": "http://example.org/foo/bar",
305     "href": "http://example.org/foo/bar",
306     "origin": "http://example.org",
307     "protocol": "http:",
308     "username": "",
309     "password": "",
310     "host": "example.org",
311     "hostname": "example.org",
312     "port": "",
313     "pathname": "/foo/bar",
314     "search": "",
315     "hash": ""
316   },
317   {
318     "input": ":foo.com/",
319     "base": "http://example.org/foo/bar",
320     "href": "http://example.org/foo/:foo.com/",
321     "origin": "http://example.org",
322     "protocol": "http:",
323     "username": "",
324     "password": "",
325     "host": "example.org",
326     "hostname": "example.org",
327     "port": "",
328     "pathname": "/foo/:foo.com/",
329     "search": "",
330     "hash": ""
331   },
332   {
333     "input": ":foo.com\\",
334     "base": "http://example.org/foo/bar",
335     "href": "http://example.org/foo/:foo.com/",
336     "origin": "http://example.org",
337     "protocol": "http:",
338     "username": "",
339     "password": "",
340     "host": "example.org",
341     "hostname": "example.org",
342     "port": "",
343     "pathname": "/foo/:foo.com/",
344     "search": "",
345     "hash": ""
346   },
347   {
348     "input": ":",
349     "base": "http://example.org/foo/bar",
350     "href": "http://example.org/foo/:",
351     "origin": "http://example.org",
352     "protocol": "http:",
353     "username": "",
354     "password": "",
355     "host": "example.org",
356     "hostname": "example.org",
357     "port": "",
358     "pathname": "/foo/:",
359     "search": "",
360     "hash": ""
361   },
362   {
363     "input": ":a",
364     "base": "http://example.org/foo/bar",
365     "href": "http://example.org/foo/:a",
366     "origin": "http://example.org",
367     "protocol": "http:",
368     "username": "",
369     "password": "",
370     "host": "example.org",
371     "hostname": "example.org",
372     "port": "",
373     "pathname": "/foo/:a",
374     "search": "",
375     "hash": ""
376   },
377   {
378     "input": ":/",
379     "base": "http://example.org/foo/bar",
380     "href": "http://example.org/foo/:/",
381     "origin": "http://example.org",
382     "protocol": "http:",
383     "username": "",
384     "password": "",
385     "host": "example.org",
386     "hostname": "example.org",
387     "port": "",
388     "pathname": "/foo/:/",
389     "search": "",
390     "hash": ""
391   },
392   {
393     "input": ":\\",
394     "base": "http://example.org/foo/bar",
395     "href": "http://example.org/foo/:/",
396     "origin": "http://example.org",
397     "protocol": "http:",
398     "username": "",
399     "password": "",
400     "host": "example.org",
401     "hostname": "example.org",
402     "port": "",
403     "pathname": "/foo/:/",
404     "search": "",
405     "hash": ""
406   },
407   {
408     "input": ":#",
409     "base": "http://example.org/foo/bar",
410     "href": "http://example.org/foo/:#",
411     "origin": "http://example.org",
412     "protocol": "http:",
413     "username": "",
414     "password": "",
415     "host": "example.org",
416     "hostname": "example.org",
417     "port": "",
418     "pathname": "/foo/:",
419     "search": "",
420     "hash": ""
421   },
422   {
423     "input": "#",
424     "base": "http://example.org/foo/bar",
425     "href": "http://example.org/foo/bar#",
426     "origin": "http://example.org",
427     "protocol": "http:",
428     "username": "",
429     "password": "",
430     "host": "example.org",
431     "hostname": "example.org",
432     "port": "",
433     "pathname": "/foo/bar",
434     "search": "",
435     "hash": ""
436   },
437   {
438     "input": "#/",
439     "base": "http://example.org/foo/bar",
440     "href": "http://example.org/foo/bar#/",
441     "origin": "http://example.org",
442     "protocol": "http:",
443     "username": "",
444     "password": "",
445     "host": "example.org",
446     "hostname": "example.org",
447     "port": "",
448     "pathname": "/foo/bar",
449     "search": "",
450     "hash": "#/"
451   },
452   {
453     "input": "#\\",
454     "base": "http://example.org/foo/bar",
455     "href": "http://example.org/foo/bar#\\",
456     "origin": "http://example.org",
457     "protocol": "http:",
458     "username": "",
459     "password": "",
460     "host": "example.org",
461     "hostname": "example.org",
462     "port": "",
463     "pathname": "/foo/bar",
464     "search": "",
465     "hash": "#\\"
466   },
467   {
468     "input": "#;?",
469     "base": "http://example.org/foo/bar",
470     "href": "http://example.org/foo/bar#;?",
471     "origin": "http://example.org",
472     "protocol": "http:",
473     "username": "",
474     "password": "",
475     "host": "example.org",
476     "hostname": "example.org",
477     "port": "",
478     "pathname": "/foo/bar",
479     "search": "",
480     "hash": "#;?"
481   },
482   {
483     "input": "?",
484     "base": "http://example.org/foo/bar",
485     "href": "http://example.org/foo/bar?",
486     "origin": "http://example.org",
487     "protocol": "http:",
488     "username": "",
489     "password": "",
490     "host": "example.org",
491     "hostname": "example.org",
492     "port": "",
493     "pathname": "/foo/bar",
494     "search": "",
495     "hash": ""
496   },
497   {
498     "input": "/",
499     "base": "http://example.org/foo/bar",
500     "href": "http://example.org/",
501     "origin": "http://example.org",
502     "protocol": "http:",
503     "username": "",
504     "password": "",
505     "host": "example.org",
506     "hostname": "example.org",
507     "port": "",
508     "pathname": "/",
509     "search": "",
510     "hash": ""
511   },
512   {
513     "input": ":23",
514     "base": "http://example.org/foo/bar",
515     "href": "http://example.org/foo/:23",
516     "origin": "http://example.org",
517     "protocol": "http:",
518     "username": "",
519     "password": "",
520     "host": "example.org",
521     "hostname": "example.org",
522     "port": "",
523     "pathname": "/foo/:23",
524     "search": "",
525     "hash": ""
526   },
527   {
528     "input": "/:23",
529     "base": "http://example.org/foo/bar",
530     "href": "http://example.org/:23",
531     "origin": "http://example.org",
532     "protocol": "http:",
533     "username": "",
534     "password": "",
535     "host": "example.org",
536     "hostname": "example.org",
537     "port": "",
538     "pathname": "/:23",
539     "search": "",
540     "hash": ""
541   },
542   {
543     "input": "\\x",
544     "base": "http://example.org/foo/bar",
545     "href": "http://example.org/x",
546     "origin": "http://example.org",
547     "protocol": "http:",
548     "username": "",
549     "password": "",
550     "host": "example.org",
551     "hostname": "example.org",
552     "port": "",
553     "pathname": "/x",
554     "search": "",
555     "hash": ""
556   },
557   {
558     "input": "\\\\x\\hello",
559     "base": "http://example.org/foo/bar",
560     "href": "http://x/hello",
561     "origin": "http://x",
562     "protocol": "http:",
563     "username": "",
564     "password": "",
565     "host": "x",
566     "hostname": "x",
567     "port": "",
568     "pathname": "/hello",
569     "search": "",
570     "hash": ""
571   },
572   {
573     "input": "::",
574     "base": "http://example.org/foo/bar",
575     "href": "http://example.org/foo/::",
576     "origin": "http://example.org",
577     "protocol": "http:",
578     "username": "",
579     "password": "",
580     "host": "example.org",
581     "hostname": "example.org",
582     "port": "",
583     "pathname": "/foo/::",
584     "search": "",
585     "hash": ""
586   },
587   {
588     "input": "::23",
589     "base": "http://example.org/foo/bar",
590     "href": "http://example.org/foo/::23",
591     "origin": "http://example.org",
592     "protocol": "http:",
593     "username": "",
594     "password": "",
595     "host": "example.org",
596     "hostname": "example.org",
597     "port": "",
598     "pathname": "/foo/::23",
599     "search": "",
600     "hash": ""
601   },
602   {
603     "input": "foo://",
604     "base": "http://example.org/foo/bar",
605     "href": "foo://",
606     "origin": "null",
607     "protocol": "foo:",
608     "username": "",
609     "password": "",
610     "host": "",
611     "hostname": "",
612     "port": "",
613     "pathname": "",
614     "search": "",
615     "hash": ""
616   },
617   {
618     "input": "http://a:b@c:29/d",
619     "base": "http://example.org/foo/bar",
620     "href": "http://a:b@c:29/d",
621     "origin": "http://c:29",
622     "protocol": "http:",
623     "username": "a",
624     "password": "b",
625     "host": "c:29",
626     "hostname": "c",
627     "port": "29",
628     "pathname": "/d",
629     "search": "",
630     "hash": ""
631   },
632   {
633     "input": "http::@c:29",
634     "base": "http://example.org/foo/bar",
635     "href": "http://example.org/foo/:@c:29",
636     "origin": "http://example.org",
637     "protocol": "http:",
638     "username": "",
639     "password": "",
640     "host": "example.org",
641     "hostname": "example.org",
642     "port": "",
643     "pathname": "/foo/:@c:29",
644     "search": "",
645     "hash": ""
646   },
647   {
648     "input": "http://&a:foo(b]c@d:2/",
649     "base": "http://example.org/foo/bar",
650     "href": "http://&a:foo(b%5Dc@d:2/",
651     "origin": "http://d:2",
652     "protocol": "http:",
653     "username": "&a",
654     "password": "foo(b%5Dc",
655     "host": "d:2",
656     "hostname": "d",
657     "port": "2",
658     "pathname": "/",
659     "search": "",
660     "hash": ""
661   },
662   {
663     "input": "http://::@c@d:2",
664     "base": "http://example.org/foo/bar",
665     "href": "http://:%3A%40c@d:2/",
666     "origin": "http://d:2",
667     "protocol": "http:",
668     "username": "",
669     "password": "%3A%40c",
670     "host": "d:2",
671     "hostname": "d",
672     "port": "2",
673     "pathname": "/",
674     "search": "",
675     "hash": ""
676   },
677   {
678     "input": "http://foo.com:b@d/",
679     "base": "http://example.org/foo/bar",
680     "href": "http://foo.com:b@d/",
681     "origin": "http://d",
682     "protocol": "http:",
683     "username": "foo.com",
684     "password": "b",
685     "host": "d",
686     "hostname": "d",
687     "port": "",
688     "pathname": "/",
689     "search": "",
690     "hash": ""
691   },
692   {
693     "input": "http://foo.com/\\@",
694     "base": "http://example.org/foo/bar",
695     "href": "http://foo.com//@",
696     "origin": "http://foo.com",
697     "protocol": "http:",
698     "username": "",
699     "password": "",
700     "host": "foo.com",
701     "hostname": "foo.com",
702     "port": "",
703     "pathname": "//@",
704     "search": "",
705     "hash": ""
706   },
707   {
708     "input": "http:\\\\foo.com\\",
709     "base": "http://example.org/foo/bar",
710     "href": "http://foo.com/",
711     "origin": "http://foo.com",
712     "protocol": "http:",
713     "username": "",
714     "password": "",
715     "host": "foo.com",
716     "hostname": "foo.com",
717     "port": "",
718     "pathname": "/",
719     "search": "",
720     "hash": ""
721   },
722   {
723     "input": "http:\\\\a\\b:c\\d@foo.com\\",
724     "base": "http://example.org/foo/bar",
725     "href": "http://a/b:c/d@foo.com/",
726     "origin": "http://a",
727     "protocol": "http:",
728     "username": "",
729     "password": "",
730     "host": "a",
731     "hostname": "a",
732     "port": "",
733     "pathname": "/b:c/d@foo.com/",
734     "search": "",
735     "hash": ""
736   },
737   {
738     "input": "foo:/",
739     "base": "http://example.org/foo/bar",
740     "href": "foo:/",
741     "origin": "null",
742     "protocol": "foo:",
743     "username": "",
744     "password": "",
745     "host": "",
746     "hostname": "",
747     "port": "",
748     "pathname": "/",
749     "search": "",
750     "hash": ""
751   },
752   {
753     "input": "foo:/bar.com/",
754     "base": "http://example.org/foo/bar",
755     "href": "foo:/bar.com/",
756     "origin": "null",
757     "protocol": "foo:",
758     "username": "",
759     "password": "",
760     "host": "",
761     "hostname": "",
762     "port": "",
763     "pathname": "/bar.com/",
764     "search": "",
765     "hash": ""
766   },
767   {
768     "input": "foo://///////",
769     "base": "http://example.org/foo/bar",
770     "href": "foo://///////",
771     "origin": "null",
772     "protocol": "foo:",
773     "username": "",
774     "password": "",
775     "host": "",
776     "hostname": "",
777     "port": "",
778     "pathname": "///////",
779     "search": "",
780     "hash": ""
781   },
782   {
783     "input": "foo://///////bar.com/",
784     "base": "http://example.org/foo/bar",
785     "href": "foo://///////bar.com/",
786     "origin": "null",
787     "protocol": "foo:",
788     "username": "",
789     "password": "",
790     "host": "",
791     "hostname": "",
792     "port": "",
793     "pathname": "///////bar.com/",
794     "search": "",
795     "hash": ""
796   },
797   {
798     "input": "foo:////://///",
799     "base": "http://example.org/foo/bar",
800     "href": "foo:////://///",
801     "origin": "null",
802     "protocol": "foo:",
803     "username": "",
804     "password": "",
805     "host": "",
806     "hostname": "",
807     "port": "",
808     "pathname": "//://///",
809     "search": "",
810     "hash": ""
811   },
812   {
813     "input": "c:/foo",
814     "base": "http://example.org/foo/bar",
815     "href": "c:/foo",
816     "origin": "null",
817     "protocol": "c:",
818     "username": "",
819     "password": "",
820     "host": "",
821     "hostname": "",
822     "port": "",
823     "pathname": "/foo",
824     "search": "",
825     "hash": ""
826   },
827   {
828     "input": "//foo/bar",
829     "base": "http://example.org/foo/bar",
830     "href": "http://foo/bar",
831     "origin": "http://foo",
832     "protocol": "http:",
833     "username": "",
834     "password": "",
835     "host": "foo",
836     "hostname": "foo",
837     "port": "",
838     "pathname": "/bar",
839     "search": "",
840     "hash": ""
841   },
842   {
843     "input": "http://foo/path;a??e#f#g",
844     "base": "http://example.org/foo/bar",
845     "href": "http://foo/path;a??e#f#g",
846     "origin": "http://foo",
847     "protocol": "http:",
848     "username": "",
849     "password": "",
850     "host": "foo",
851     "hostname": "foo",
852     "port": "",
853     "pathname": "/path;a",
854     "search": "??e",
855     "hash": "#f#g"
856   },
857   {
858     "input": "http://foo/abcd?efgh?ijkl",
859     "base": "http://example.org/foo/bar",
860     "href": "http://foo/abcd?efgh?ijkl",
861     "origin": "http://foo",
862     "protocol": "http:",
863     "username": "",
864     "password": "",
865     "host": "foo",
866     "hostname": "foo",
867     "port": "",
868     "pathname": "/abcd",
869     "search": "?efgh?ijkl",
870     "hash": ""
871   },
872   {
873     "input": "http://foo/abcd#foo?bar",
874     "base": "http://example.org/foo/bar",
875     "href": "http://foo/abcd#foo?bar",
876     "origin": "http://foo",
877     "protocol": "http:",
878     "username": "",
879     "password": "",
880     "host": "foo",
881     "hostname": "foo",
882     "port": "",
883     "pathname": "/abcd",
884     "search": "",
885     "hash": "#foo?bar"
886   },
887   {
888     "input": "[61:24:74]:98",
889     "base": "http://example.org/foo/bar",
890     "href": "http://example.org/foo/[61:24:74]:98",
891     "origin": "http://example.org",
892     "protocol": "http:",
893     "username": "",
894     "password": "",
895     "host": "example.org",
896     "hostname": "example.org",
897     "port": "",
898     "pathname": "/foo/[61:24:74]:98",
899     "search": "",
900     "hash": ""
901   },
902   {
903     "input": "http:[61:27]/:foo",
904     "base": "http://example.org/foo/bar",
905     "href": "http://example.org/foo/[61:27]/:foo",
906     "origin": "http://example.org",
907     "protocol": "http:",
908     "username": "",
909     "password": "",
910     "host": "example.org",
911     "hostname": "example.org",
912     "port": "",
913     "pathname": "/foo/[61:27]/:foo",
914     "search": "",
915     "hash": ""
916   },
917   {
918     "input": "http://[1::2]:3:4",
919     "base": "http://example.org/foo/bar",
920     "failure": true
921   },
922   {
923     "input": "http://2001::1",
924     "base": "http://example.org/foo/bar",
925     "failure": true
926   },
927   {
928     "input": "http://2001::1]",
929     "base": "http://example.org/foo/bar",
930     "failure": true
931   },
932   {
933     "input": "http://2001::1]:80",
934     "base": "http://example.org/foo/bar",
935     "failure": true
936   },
937   {
938     "input": "http://[2001::1]",
939     "base": "http://example.org/foo/bar",
940     "href": "http://[2001::1]/",
941     "origin": "http://[2001::1]",
942     "protocol": "http:",
943     "username": "",
944     "password": "",
945     "host": "[2001::1]",
946     "hostname": "[2001::1]",
947     "port": "",
948     "pathname": "/",
949     "search": "",
950     "hash": ""
951   },
952   {
953     "input": "http://[::127.0.0.1]",
954     "base": "http://example.org/foo/bar",
955     "href": "http://[::7f00:1]/",
956     "origin": "http://[::7f00:1]",
957     "protocol": "http:",
958     "username": "",
959     "password": "",
960     "host": "[::7f00:1]",
961     "hostname": "[::7f00:1]",
962     "port": "",
963     "pathname": "/",
964     "search": "",
965     "hash": ""
966   },
967   {
968     "input": "http://[::127.0.0.1.]",
969     "base": "http://example.org/foo/bar",
970     "failure": true
971   },
972   {
973     "input": "http://[0:0:0:0:0:0:13.1.68.3]",
974     "base": "http://example.org/foo/bar",
975     "href": "http://[::d01:4403]/",
976     "origin": "http://[::d01:4403]",
977     "protocol": "http:",
978     "username": "",
979     "password": "",
980     "host": "[::d01:4403]",
981     "hostname": "[::d01:4403]",
982     "port": "",
983     "pathname": "/",
984     "search": "",
985     "hash": ""
986   },
987   {
988     "input": "http://[2001::1]:80",
989     "base": "http://example.org/foo/bar",
990     "href": "http://[2001::1]/",
991     "origin": "http://[2001::1]",
992     "protocol": "http:",
993     "username": "",
994     "password": "",
995     "host": "[2001::1]",
996     "hostname": "[2001::1]",
997     "port": "",
998     "pathname": "/",
999     "search": "",
1000     "hash": ""
1001   },
1002   {
1003     "input": "http:/example.com/",
1004     "base": "http://example.org/foo/bar",
1005     "href": "http://example.org/example.com/",
1006     "origin": "http://example.org",
1007     "protocol": "http:",
1008     "username": "",
1009     "password": "",
1010     "host": "example.org",
1011     "hostname": "example.org",
1012     "port": "",
1013     "pathname": "/example.com/",
1014     "search": "",
1015     "hash": ""
1016   },
1017   {
1018     "input": "ftp:/example.com/",
1019     "base": "http://example.org/foo/bar",
1020     "href": "ftp://example.com/",
1021     "origin": "ftp://example.com",
1022     "protocol": "ftp:",
1023     "username": "",
1024     "password": "",
1025     "host": "example.com",
1026     "hostname": "example.com",
1027     "port": "",
1028     "pathname": "/",
1029     "search": "",
1030     "hash": ""
1031   },
1032   {
1033     "input": "https:/example.com/",
1034     "base": "http://example.org/foo/bar",
1035     "href": "https://example.com/",
1036     "origin": "https://example.com",
1037     "protocol": "https:",
1038     "username": "",
1039     "password": "",
1040     "host": "example.com",
1041     "hostname": "example.com",
1042     "port": "",
1043     "pathname": "/",
1044     "search": "",
1045     "hash": ""
1046   },
1047   {
1048     "input": "madeupscheme:/example.com/",
1049     "base": "http://example.org/foo/bar",
1050     "href": "madeupscheme:/example.com/",
1051     "origin": "null",
1052     "protocol": "madeupscheme:",
1053     "username": "",
1054     "password": "",
1055     "host": "",
1056     "hostname": "",
1057     "port": "",
1058     "pathname": "/example.com/",
1059     "search": "",
1060     "hash": ""
1061   },
1062   {
1063     "input": "file:/example.com/",
1064     "base": "http://example.org/foo/bar",
1065     "href": "file:///example.com/",
1066     "protocol": "file:",
1067     "username": "",
1068     "password": "",
1069     "host": "",
1070     "hostname": "",
1071     "port": "",
1072     "pathname": "/example.com/",
1073     "search": "",
1074     "hash": ""
1075   },
1076   {
1077     "input": "file://example:1/",
1078     "base": null,
1079     "failure": true
1080   },
1081   {
1082     "input": "file://example:test/",
1083     "base": null,
1084     "failure": true
1085   },
1086   {
1087     "input": "file://example%/",
1088     "base": null,
1089     "failure": true
1090   },
1091   {
1092     "input": "file://[example]/",
1093     "base": null,
1094     "failure": true
1095   },
1096   {
1097     "input": "ftps:/example.com/",
1098     "base": "http://example.org/foo/bar",
1099     "href": "ftps:/example.com/",
1100     "origin": "null",
1101     "protocol": "ftps:",
1102     "username": "",
1103     "password": "",
1104     "host": "",
1105     "hostname": "",
1106     "port": "",
1107     "pathname": "/example.com/",
1108     "search": "",
1109     "hash": ""
1110   },
1111   {
1112     "input": "gopher:/example.com/",
1113     "base": "http://example.org/foo/bar",
1114     "href": "gopher:/example.com/",
1115     "origin": "null",
1116     "protocol": "gopher:",
1117     "username": "",
1118     "password": "",
1119     "host": "",
1120     "hostname": "",
1121     "port": "",
1122     "pathname": "/example.com/",
1123     "search": "",
1124     "hash": ""
1125   },
1126   {
1127     "input": "ws:/example.com/",
1128     "base": "http://example.org/foo/bar",
1129     "href": "ws://example.com/",
1130     "origin": "ws://example.com",
1131     "protocol": "ws:",
1132     "username": "",
1133     "password": "",
1134     "host": "example.com",
1135     "hostname": "example.com",
1136     "port": "",
1137     "pathname": "/",
1138     "search": "",
1139     "hash": ""
1140   },
1141   {
1142     "input": "wss:/example.com/",
1143     "base": "http://example.org/foo/bar",
1144     "href": "wss://example.com/",
1145     "origin": "wss://example.com",
1146     "protocol": "wss:",
1147     "username": "",
1148     "password": "",
1149     "host": "example.com",
1150     "hostname": "example.com",
1151     "port": "",
1152     "pathname": "/",
1153     "search": "",
1154     "hash": ""
1155   },
1156   {
1157     "input": "data:/example.com/",
1158     "base": "http://example.org/foo/bar",
1159     "href": "data:/example.com/",
1160     "origin": "null",
1161     "protocol": "data:",
1162     "username": "",
1163     "password": "",
1164     "host": "",
1165     "hostname": "",
1166     "port": "",
1167     "pathname": "/example.com/",
1168     "search": "",
1169     "hash": ""
1170   },
1171   {
1172     "input": "javascript:/example.com/",
1173     "base": "http://example.org/foo/bar",
1174     "href": "javascript:/example.com/",
1175     "origin": "null",
1176     "protocol": "javascript:",
1177     "username": "",
1178     "password": "",
1179     "host": "",
1180     "hostname": "",
1181     "port": "",
1182     "pathname": "/example.com/",
1183     "search": "",
1184     "hash": ""
1185   },
1186   {
1187     "input": "mailto:/example.com/",
1188     "base": "http://example.org/foo/bar",
1189     "href": "mailto:/example.com/",
1190     "origin": "null",
1191     "protocol": "mailto:",
1192     "username": "",
1193     "password": "",
1194     "host": "",
1195     "hostname": "",
1196     "port": "",
1197     "pathname": "/example.com/",
1198     "search": "",
1199     "hash": ""
1200   },
1201   {
1202     "input": "http:example.com/",
1203     "base": "http://example.org/foo/bar",
1204     "href": "http://example.org/foo/example.com/",
1205     "origin": "http://example.org",
1206     "protocol": "http:",
1207     "username": "",
1208     "password": "",
1209     "host": "example.org",
1210     "hostname": "example.org",
1211     "port": "",
1212     "pathname": "/foo/example.com/",
1213     "search": "",
1214     "hash": ""
1215   },
1216   {
1217     "input": "ftp:example.com/",
1218     "base": "http://example.org/foo/bar",
1219     "href": "ftp://example.com/",
1220     "origin": "ftp://example.com",
1221     "protocol": "ftp:",
1222     "username": "",
1223     "password": "",
1224     "host": "example.com",
1225     "hostname": "example.com",
1226     "port": "",
1227     "pathname": "/",
1228     "search": "",
1229     "hash": ""
1230   },
1231   {
1232     "input": "https:example.com/",
1233     "base": "http://example.org/foo/bar",
1234     "href": "https://example.com/",
1235     "origin": "https://example.com",
1236     "protocol": "https:",
1237     "username": "",
1238     "password": "",
1239     "host": "example.com",
1240     "hostname": "example.com",
1241     "port": "",
1242     "pathname": "/",
1243     "search": "",
1244     "hash": ""
1245   },
1246   {
1247     "input": "madeupscheme:example.com/",
1248     "base": "http://example.org/foo/bar",
1249     "href": "madeupscheme:example.com/",
1250     "origin": "null",
1251     "protocol": "madeupscheme:",
1252     "username": "",
1253     "password": "",
1254     "host": "",
1255     "hostname": "",
1256     "port": "",
1257     "pathname": "example.com/",
1258     "search": "",
1259     "hash": ""
1260   },
1261   {
1262     "input": "ftps:example.com/",
1263     "base": "http://example.org/foo/bar",
1264     "href": "ftps:example.com/",
1265     "origin": "null",
1266     "protocol": "ftps:",
1267     "username": "",
1268     "password": "",
1269     "host": "",
1270     "hostname": "",
1271     "port": "",
1272     "pathname": "example.com/",
1273     "search": "",
1274     "hash": ""
1275   },
1276   {
1277     "input": "gopher:example.com/",
1278     "base": "http://example.org/foo/bar",
1279     "href": "gopher:example.com/",
1280     "origin": "null",
1281     "protocol": "gopher:",
1282     "username": "",
1283     "password": "",
1284     "host": "",
1285     "hostname": "",
1286     "port": "",
1287     "pathname": "example.com/",
1288     "search": "",
1289     "hash": ""
1290   },
1291   {
1292     "input": "ws:example.com/",
1293     "base": "http://example.org/foo/bar",
1294     "href": "ws://example.com/",
1295     "origin": "ws://example.com",
1296     "protocol": "ws:",
1297     "username": "",
1298     "password": "",
1299     "host": "example.com",
1300     "hostname": "example.com",
1301     "port": "",
1302     "pathname": "/",
1303     "search": "",
1304     "hash": ""
1305   },
1306   {
1307     "input": "wss:example.com/",
1308     "base": "http://example.org/foo/bar",
1309     "href": "wss://example.com/",
1310     "origin": "wss://example.com",
1311     "protocol": "wss:",
1312     "username": "",
1313     "password": "",
1314     "host": "example.com",
1315     "hostname": "example.com",
1316     "port": "",
1317     "pathname": "/",
1318     "search": "",
1319     "hash": ""
1320   },
1321   {
1322     "input": "data:example.com/",
1323     "base": "http://example.org/foo/bar",
1324     "href": "data:example.com/",
1325     "origin": "null",
1326     "protocol": "data:",
1327     "username": "",
1328     "password": "",
1329     "host": "",
1330     "hostname": "",
1331     "port": "",
1332     "pathname": "example.com/",
1333     "search": "",
1334     "hash": ""
1335   },
1336   {
1337     "input": "javascript:example.com/",
1338     "base": "http://example.org/foo/bar",
1339     "href": "javascript:example.com/",
1340     "origin": "null",
1341     "protocol": "javascript:",
1342     "username": "",
1343     "password": "",
1344     "host": "",
1345     "hostname": "",
1346     "port": "",
1347     "pathname": "example.com/",
1348     "search": "",
1349     "hash": ""
1350   },
1351   {
1352     "input": "mailto:example.com/",
1353     "base": "http://example.org/foo/bar",
1354     "href": "mailto:example.com/",
1355     "origin": "null",
1356     "protocol": "mailto:",
1357     "username": "",
1358     "password": "",
1359     "host": "",
1360     "hostname": "",
1361     "port": "",
1362     "pathname": "example.com/",
1363     "search": "",
1364     "hash": ""
1365   },
1366   {
1367     "input": "/a/b/c",
1368     "base": "http://example.org/foo/bar",
1369     "href": "http://example.org/a/b/c",
1370     "origin": "http://example.org",
1371     "protocol": "http:",
1372     "username": "",
1373     "password": "",
1374     "host": "example.org",
1375     "hostname": "example.org",
1376     "port": "",
1377     "pathname": "/a/b/c",
1378     "search": "",
1379     "hash": ""
1380   },
1381   {
1382     "input": "/a/ /c",
1383     "base": "http://example.org/foo/bar",
1384     "href": "http://example.org/a/%20/c",
1385     "origin": "http://example.org",
1386     "protocol": "http:",
1387     "username": "",
1388     "password": "",
1389     "host": "example.org",
1390     "hostname": "example.org",
1391     "port": "",
1392     "pathname": "/a/%20/c",
1393     "search": "",
1394     "hash": ""
1395   },
1396   {
1397     "input": "/a%2fc",
1398     "base": "http://example.org/foo/bar",
1399     "href": "http://example.org/a%2fc",
1400     "origin": "http://example.org",
1401     "protocol": "http:",
1402     "username": "",
1403     "password": "",
1404     "host": "example.org",
1405     "hostname": "example.org",
1406     "port": "",
1407     "pathname": "/a%2fc",
1408     "search": "",
1409     "hash": ""
1410   },
1411   {
1412     "input": "/a/%2f/c",
1413     "base": "http://example.org/foo/bar",
1414     "href": "http://example.org/a/%2f/c",
1415     "origin": "http://example.org",
1416     "protocol": "http:",
1417     "username": "",
1418     "password": "",
1419     "host": "example.org",
1420     "hostname": "example.org",
1421     "port": "",
1422     "pathname": "/a/%2f/c",
1423     "search": "",
1424     "hash": ""
1425   },
1426   {
1427     "input": "#β",
1428     "base": "http://example.org/foo/bar",
1429     "href": "http://example.org/foo/bar#%CE%B2",
1430     "origin": "http://example.org",
1431     "protocol": "http:",
1432     "username": "",
1433     "password": "",
1434     "host": "example.org",
1435     "hostname": "example.org",
1436     "port": "",
1437     "pathname": "/foo/bar",
1438     "search": "",
1439     "hash": "#%CE%B2"
1440   },
1441   {
1442     "input": "data:text/html,test#test",
1443     "base": "http://example.org/foo/bar",
1444     "href": "data:text/html,test#test",
1445     "origin": "null",
1446     "protocol": "data:",
1447     "username": "",
1448     "password": "",
1449     "host": "",
1450     "hostname": "",
1451     "port": "",
1452     "pathname": "text/html,test",
1453     "search": "",
1454     "hash": "#test"
1455   },
1456   {
1457     "input": "tel:1234567890",
1458     "base": "http://example.org/foo/bar",
1459     "href": "tel:1234567890",
1460     "origin": "null",
1461     "protocol": "tel:",
1462     "username": "",
1463     "password": "",
1464     "host": "",
1465     "hostname": "",
1466     "port": "",
1467     "pathname": "1234567890",
1468     "search": "",
1469     "hash": ""
1470   },
1471   "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/file.html",
1472   {
1473     "input": "file:c:\\foo\\bar.html",
1474     "base": "file:///tmp/mock/path",
1475     "href": "file:///c:/foo/bar.html",
1476     "protocol": "file:",
1477     "username": "",
1478     "password": "",
1479     "host": "",
1480     "hostname": "",
1481     "port": "",
1482     "pathname": "/c:/foo/bar.html",
1483     "search": "",
1484     "hash": ""
1485   },
1486   {
1487     "input": "  File:c|////foo\\bar.html",
1488     "base": "file:///tmp/mock/path",
1489     "href": "file:///c:////foo/bar.html",
1490     "protocol": "file:",
1491     "username": "",
1492     "password": "",
1493     "host": "",
1494     "hostname": "",
1495     "port": "",
1496     "pathname": "/c:////foo/bar.html",
1497     "search": "",
1498     "hash": ""
1499   },
1500   {
1501     "input": "C|/foo/bar",
1502     "base": "file:///tmp/mock/path",
1503     "href": "file:///C:/foo/bar",
1504     "protocol": "file:",
1505     "username": "",
1506     "password": "",
1507     "host": "",
1508     "hostname": "",
1509     "port": "",
1510     "pathname": "/C:/foo/bar",
1511     "search": "",
1512     "hash": ""
1513   },
1514   {
1515     "input": "/C|\\foo\\bar",
1516     "base": "file:///tmp/mock/path",
1517     "href": "file:///C:/foo/bar",
1518     "protocol": "file:",
1519     "username": "",
1520     "password": "",
1521     "host": "",
1522     "hostname": "",
1523     "port": "",
1524     "pathname": "/C:/foo/bar",
1525     "search": "",
1526     "hash": ""
1527   },
1528   {
1529     "input": "//C|/foo/bar",
1530     "base": "file:///tmp/mock/path",
1531     "href": "file:///C:/foo/bar",
1532     "protocol": "file:",
1533     "username": "",
1534     "password": "",
1535     "host": "",
1536     "hostname": "",
1537     "port": "",
1538     "pathname": "/C:/foo/bar",
1539     "search": "",
1540     "hash": ""
1541   },
1542   {
1543     "input": "//server/file",
1544     "base": "file:///tmp/mock/path",
1545     "href": "file://server/file",
1546     "protocol": "file:",
1547     "username": "",
1548     "password": "",
1549     "host": "server",
1550     "hostname": "server",
1551     "port": "",
1552     "pathname": "/file",
1553     "search": "",
1554     "hash": ""
1555   },
1556   {
1557     "input": "\\\\server\\file",
1558     "base": "file:///tmp/mock/path",
1559     "href": "file://server/file",
1560     "protocol": "file:",
1561     "username": "",
1562     "password": "",
1563     "host": "server",
1564     "hostname": "server",
1565     "port": "",
1566     "pathname": "/file",
1567     "search": "",
1568     "hash": ""
1569   },
1570   {
1571     "input": "/\\server/file",
1572     "base": "file:///tmp/mock/path",
1573     "href": "file://server/file",
1574     "protocol": "file:",
1575     "username": "",
1576     "password": "",
1577     "host": "server",
1578     "hostname": "server",
1579     "port": "",
1580     "pathname": "/file",
1581     "search": "",
1582     "hash": ""
1583   },
1584   {
1585     "input": "file:///foo/bar.txt",
1586     "base": "file:///tmp/mock/path",
1587     "href": "file:///foo/bar.txt",
1588     "protocol": "file:",
1589     "username": "",
1590     "password": "",
1591     "host": "",
1592     "hostname": "",
1593     "port": "",
1594     "pathname": "/foo/bar.txt",
1595     "search": "",
1596     "hash": ""
1597   },
1598   {
1599     "input": "file:///home/me",
1600     "base": "file:///tmp/mock/path",
1601     "href": "file:///home/me",
1602     "protocol": "file:",
1603     "username": "",
1604     "password": "",
1605     "host": "",
1606     "hostname": "",
1607     "port": "",
1608     "pathname": "/home/me",
1609     "search": "",
1610     "hash": ""
1611   },
1612   {
1613     "input": "//",
1614     "base": "file:///tmp/mock/path",
1615     "href": "file:///",
1616     "protocol": "file:",
1617     "username": "",
1618     "password": "",
1619     "host": "",
1620     "hostname": "",
1621     "port": "",
1622     "pathname": "/",
1623     "search": "",
1624     "hash": ""
1625   },
1626   {
1627     "input": "///",
1628     "base": "file:///tmp/mock/path",
1629     "href": "file:///",
1630     "protocol": "file:",
1631     "username": "",
1632     "password": "",
1633     "host": "",
1634     "hostname": "",
1635     "port": "",
1636     "pathname": "/",
1637     "search": "",
1638     "hash": ""
1639   },
1640   {
1641     "input": "///test",
1642     "base": "file:///tmp/mock/path",
1643     "href": "file:///test",
1644     "protocol": "file:",
1645     "username": "",
1646     "password": "",
1647     "host": "",
1648     "hostname": "",
1649     "port": "",
1650     "pathname": "/test",
1651     "search": "",
1652     "hash": ""
1653   },
1654   {
1655     "input": "file://test",
1656     "base": "file:///tmp/mock/path",
1657     "href": "file://test/",
1658     "protocol": "file:",
1659     "username": "",
1660     "password": "",
1661     "host": "test",
1662     "hostname": "test",
1663     "port": "",
1664     "pathname": "/",
1665     "search": "",
1666     "hash": ""
1667   },
1668   {
1669     "input": "file://localhost",
1670     "base": "file:///tmp/mock/path",
1671     "href": "file:///",
1672     "protocol": "file:",
1673     "username": "",
1674     "password": "",
1675     "host": "",
1676     "hostname": "",
1677     "port": "",
1678     "pathname": "/",
1679     "search": "",
1680     "hash": ""
1681   },
1682   {
1683     "input": "file://localhost/",
1684     "base": "file:///tmp/mock/path",
1685     "href": "file:///",
1686     "protocol": "file:",
1687     "username": "",
1688     "password": "",
1689     "host": "",
1690     "hostname": "",
1691     "port": "",
1692     "pathname": "/",
1693     "search": "",
1694     "hash": ""
1695   },
1696   {
1697     "input": "file://localhost/test",
1698     "base": "file:///tmp/mock/path",
1699     "href": "file:///test",
1700     "protocol": "file:",
1701     "username": "",
1702     "password": "",
1703     "host": "",
1704     "hostname": "",
1705     "port": "",
1706     "pathname": "/test",
1707     "search": "",
1708     "hash": ""
1709   },
1710   {
1711     "input": "test",
1712     "base": "file:///tmp/mock/path",
1713     "href": "file:///tmp/mock/test",
1714     "protocol": "file:",
1715     "username": "",
1716     "password": "",
1717     "host": "",
1718     "hostname": "",
1719     "port": "",
1720     "pathname": "/tmp/mock/test",
1721     "search": "",
1722     "hash": ""
1723   },
1724   {
1725     "input": "file:test",
1726     "base": "file:///tmp/mock/path",
1727     "href": "file:///tmp/mock/test",
1728     "protocol": "file:",
1729     "username": "",
1730     "password": "",
1731     "host": "",
1732     "hostname": "",
1733     "port": "",
1734     "pathname": "/tmp/mock/test",
1735     "search": "",
1736     "hash": ""
1737   },
1738   "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js",
1739   {
1740     "input": "http://example.com/././foo",
1741     "base": null,
1742     "href": "http://example.com/foo",
1743     "origin": "http://example.com",
1744     "protocol": "http:",
1745     "username": "",
1746     "password": "",
1747     "host": "example.com",
1748     "hostname": "example.com",
1749     "port": "",
1750     "pathname": "/foo",
1751     "search": "",
1752     "hash": ""
1753   },
1754   {
1755     "input": "http://example.com/./.foo",
1756     "base": null,
1757     "href": "http://example.com/.foo",
1758     "origin": "http://example.com",
1759     "protocol": "http:",
1760     "username": "",
1761     "password": "",
1762     "host": "example.com",
1763     "hostname": "example.com",
1764     "port": "",
1765     "pathname": "/.foo",
1766     "search": "",
1767     "hash": ""
1768   },
1769   {
1770     "input": "http://example.com/foo/.",
1771     "base": null,
1772     "href": "http://example.com/foo/",
1773     "origin": "http://example.com",
1774     "protocol": "http:",
1775     "username": "",
1776     "password": "",
1777     "host": "example.com",
1778     "hostname": "example.com",
1779     "port": "",
1780     "pathname": "/foo/",
1781     "search": "",
1782     "hash": ""
1783   },
1784   {
1785     "input": "http://example.com/foo/./",
1786     "base": null,
1787     "href": "http://example.com/foo/",
1788     "origin": "http://example.com",
1789     "protocol": "http:",
1790     "username": "",
1791     "password": "",
1792     "host": "example.com",
1793     "hostname": "example.com",
1794     "port": "",
1795     "pathname": "/foo/",
1796     "search": "",
1797     "hash": ""
1798   },
1799   {
1800     "input": "http://example.com/foo/bar/..",
1801     "base": null,
1802     "href": "http://example.com/foo/",
1803     "origin": "http://example.com",
1804     "protocol": "http:",
1805     "username": "",
1806     "password": "",
1807     "host": "example.com",
1808     "hostname": "example.com",
1809     "port": "",
1810     "pathname": "/foo/",
1811     "search": "",
1812     "hash": ""
1813   },
1814   {
1815     "input": "http://example.com/foo/bar/../",
1816     "base": null,
1817     "href": "http://example.com/foo/",
1818     "origin": "http://example.com",
1819     "protocol": "http:",
1820     "username": "",
1821     "password": "",
1822     "host": "example.com",
1823     "hostname": "example.com",
1824     "port": "",
1825     "pathname": "/foo/",
1826     "search": "",
1827     "hash": ""
1828   },
1829   {
1830     "input": "http://example.com/foo/..bar",
1831     "base": null,
1832     "href": "http://example.com/foo/..bar",
1833     "origin": "http://example.com",
1834     "protocol": "http:",
1835     "username": "",
1836     "password": "",
1837     "host": "example.com",
1838     "hostname": "example.com",
1839     "port": "",
1840     "pathname": "/foo/..bar",
1841     "search": "",
1842     "hash": ""
1843   },
1844   {
1845     "input": "http://example.com/foo/bar/../ton",
1846     "base": null,
1847     "href": "http://example.com/foo/ton",
1848     "origin": "http://example.com",
1849     "protocol": "http:",
1850     "username": "",
1851     "password": "",
1852     "host": "example.com",
1853     "hostname": "example.com",
1854     "port": "",
1855     "pathname": "/foo/ton",
1856     "search": "",
1857     "hash": ""
1858   },
1859   {
1860     "input": "http://example.com/foo/bar/../ton/../../a",
1861     "base": null,
1862     "href": "http://example.com/a",
1863     "origin": "http://example.com",
1864     "protocol": "http:",
1865     "username": "",
1866     "password": "",
1867     "host": "example.com",
1868     "hostname": "example.com",
1869     "port": "",
1870     "pathname": "/a",
1871     "search": "",
1872     "hash": ""
1873   },
1874   {
1875     "input": "http://example.com/foo/../../..",
1876     "base": null,
1877     "href": "http://example.com/",
1878     "origin": "http://example.com",
1879     "protocol": "http:",
1880     "username": "",
1881     "password": "",
1882     "host": "example.com",
1883     "hostname": "example.com",
1884     "port": "",
1885     "pathname": "/",
1886     "search": "",
1887     "hash": ""
1888   },
1889   {
1890     "input": "http://example.com/foo/../../../ton",
1891     "base": null,
1892     "href": "http://example.com/ton",
1893     "origin": "http://example.com",
1894     "protocol": "http:",
1895     "username": "",
1896     "password": "",
1897     "host": "example.com",
1898     "hostname": "example.com",
1899     "port": "",
1900     "pathname": "/ton",
1901     "search": "",
1902     "hash": ""
1903   },
1904   {
1905     "input": "http://example.com/foo/%2e",
1906     "base": null,
1907     "href": "http://example.com/foo/",
1908     "origin": "http://example.com",
1909     "protocol": "http:",
1910     "username": "",
1911     "password": "",
1912     "host": "example.com",
1913     "hostname": "example.com",
1914     "port": "",
1915     "pathname": "/foo/",
1916     "search": "",
1917     "hash": ""
1918   },
1919   {
1920     "input": "http://example.com/foo/%2e%2",
1921     "base": null,
1922     "href": "http://example.com/foo/%2e%2",
1923     "origin": "http://example.com",
1924     "protocol": "http:",
1925     "username": "",
1926     "password": "",
1927     "host": "example.com",
1928     "hostname": "example.com",
1929     "port": "",
1930     "pathname": "/foo/%2e%2",
1931     "search": "",
1932     "hash": ""
1933   },
1934   {
1935     "input": "http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar",
1936     "base": null,
1937     "href": "http://example.com/%2e.bar",
1938     "origin": "http://example.com",
1939     "protocol": "http:",
1940     "username": "",
1941     "password": "",
1942     "host": "example.com",
1943     "hostname": "example.com",
1944     "port": "",
1945     "pathname": "/%2e.bar",
1946     "search": "",
1947     "hash": ""
1948   },
1949   {
1950     "input": "http://example.com////../..",
1951     "base": null,
1952     "href": "http://example.com//",
1953     "origin": "http://example.com",
1954     "protocol": "http:",
1955     "username": "",
1956     "password": "",
1957     "host": "example.com",
1958     "hostname": "example.com",
1959     "port": "",
1960     "pathname": "//",
1961     "search": "",
1962     "hash": ""
1963   },
1964   {
1965     "input": "http://example.com/foo/bar//../..",
1966     "base": null,
1967     "href": "http://example.com/foo/",
1968     "origin": "http://example.com",
1969     "protocol": "http:",
1970     "username": "",
1971     "password": "",
1972     "host": "example.com",
1973     "hostname": "example.com",
1974     "port": "",
1975     "pathname": "/foo/",
1976     "search": "",
1977     "hash": ""
1978   },
1979   {
1980     "input": "http://example.com/foo/bar//..",
1981     "base": null,
1982     "href": "http://example.com/foo/bar/",
1983     "origin": "http://example.com",
1984     "protocol": "http:",
1985     "username": "",
1986     "password": "",
1987     "host": "example.com",
1988     "hostname": "example.com",
1989     "port": "",
1990     "pathname": "/foo/bar/",
1991     "search": "",
1992     "hash": ""
1993   },
1994   {
1995     "input": "http://example.com/foo",
1996     "base": null,
1997     "href": "http://example.com/foo",
1998     "origin": "http://example.com",
1999     "protocol": "http:",
2000     "username": "",
2001     "password": "",
2002     "host": "example.com",
2003     "hostname": "example.com",
2004     "port": "",
2005     "pathname": "/foo",
2006     "search": "",
2007     "hash": ""
2008   },
2009   {
2010     "input": "http://example.com/%20foo",
2011     "base": null,
2012     "href": "http://example.com/%20foo",
2013     "origin": "http://example.com",
2014     "protocol": "http:",
2015     "username": "",
2016     "password": "",
2017     "host": "example.com",
2018     "hostname": "example.com",
2019     "port": "",
2020     "pathname": "/%20foo",
2021     "search": "",
2022     "hash": ""
2023   },
2024   {
2025     "input": "http://example.com/foo%",
2026     "base": null,
2027     "href": "http://example.com/foo%",
2028     "origin": "http://example.com",
2029     "protocol": "http:",
2030     "username": "",
2031     "password": "",
2032     "host": "example.com",
2033     "hostname": "example.com",
2034     "port": "",
2035     "pathname": "/foo%",
2036     "search": "",
2037     "hash": ""
2038   },
2039   {
2040     "input": "http://example.com/foo%2",
2041     "base": null,
2042     "href": "http://example.com/foo%2",
2043     "origin": "http://example.com",
2044     "protocol": "http:",
2045     "username": "",
2046     "password": "",
2047     "host": "example.com",
2048     "hostname": "example.com",
2049     "port": "",
2050     "pathname": "/foo%2",
2051     "search": "",
2052     "hash": ""
2053   },
2054   {
2055     "input": "http://example.com/foo%2zbar",
2056     "base": null,
2057     "href": "http://example.com/foo%2zbar",
2058     "origin": "http://example.com",
2059     "protocol": "http:",
2060     "username": "",
2061     "password": "",
2062     "host": "example.com",
2063     "hostname": "example.com",
2064     "port": "",
2065     "pathname": "/foo%2zbar",
2066     "search": "",
2067     "hash": ""
2068   },
2069   {
2070     "input": "http://example.com/foo%2©zbar",
2071     "base": null,
2072     "href": "http://example.com/foo%2%C3%82%C2%A9zbar",
2073     "origin": "http://example.com",
2074     "protocol": "http:",
2075     "username": "",
2076     "password": "",
2077     "host": "example.com",
2078     "hostname": "example.com",
2079     "port": "",
2080     "pathname": "/foo%2%C3%82%C2%A9zbar",
2081     "search": "",
2082     "hash": ""
2083   },
2084   {
2085     "input": "http://example.com/foo%41%7a",
2086     "base": null,
2087     "href": "http://example.com/foo%41%7a",
2088     "origin": "http://example.com",
2089     "protocol": "http:",
2090     "username": "",
2091     "password": "",
2092     "host": "example.com",
2093     "hostname": "example.com",
2094     "port": "",
2095     "pathname": "/foo%41%7a",
2096     "search": "",
2097     "hash": ""
2098   },
2099   {
2100     "input": "http://example.com/foo\t\u0091%91",
2101     "base": null,
2102     "href": "http://example.com/foo%C2%91%91",
2103     "origin": "http://example.com",
2104     "protocol": "http:",
2105     "username": "",
2106     "password": "",
2107     "host": "example.com",
2108     "hostname": "example.com",
2109     "port": "",
2110     "pathname": "/foo%C2%91%91",
2111     "search": "",
2112     "hash": ""
2113   },
2114   {
2115     "input": "http://example.com/foo%00%51",
2116     "base": null,
2117     "href": "http://example.com/foo%00%51",
2118     "origin": "http://example.com",
2119     "protocol": "http:",
2120     "username": "",
2121     "password": "",
2122     "host": "example.com",
2123     "hostname": "example.com",
2124     "port": "",
2125     "pathname": "/foo%00%51",
2126     "search": "",
2127     "hash": ""
2128   },
2129   {
2130     "input": "http://example.com/(%28:%3A%29)",
2131     "base": null,
2132     "href": "http://example.com/(%28:%3A%29)",
2133     "origin": "http://example.com",
2134     "protocol": "http:",
2135     "username": "",
2136     "password": "",
2137     "host": "example.com",
2138     "hostname": "example.com",
2139     "port": "",
2140     "pathname": "/(%28:%3A%29)",
2141     "search": "",
2142     "hash": ""
2143   },
2144   {
2145     "input": "http://example.com/%3A%3a%3C%3c",
2146     "base": null,
2147     "href": "http://example.com/%3A%3a%3C%3c",
2148     "origin": "http://example.com",
2149     "protocol": "http:",
2150     "username": "",
2151     "password": "",
2152     "host": "example.com",
2153     "hostname": "example.com",
2154     "port": "",
2155     "pathname": "/%3A%3a%3C%3c",
2156     "search": "",
2157     "hash": ""
2158   },
2159   {
2160     "input": "http://example.com/foo\tbar",
2161     "base": null,
2162     "href": "http://example.com/foobar",
2163     "origin": "http://example.com",
2164     "protocol": "http:",
2165     "username": "",
2166     "password": "",
2167     "host": "example.com",
2168     "hostname": "example.com",
2169     "port": "",
2170     "pathname": "/foobar",
2171     "search": "",
2172     "hash": ""
2173   },
2174   {
2175     "input": "http://example.com\\\\foo\\\\bar",
2176     "base": null,
2177     "href": "http://example.com//foo//bar",
2178     "origin": "http://example.com",
2179     "protocol": "http:",
2180     "username": "",
2181     "password": "",
2182     "host": "example.com",
2183     "hostname": "example.com",
2184     "port": "",
2185     "pathname": "//foo//bar",
2186     "search": "",
2187     "hash": ""
2188   },
2189   {
2190     "input": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
2191     "base": null,
2192     "href": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
2193     "origin": "http://example.com",
2194     "protocol": "http:",
2195     "username": "",
2196     "password": "",
2197     "host": "example.com",
2198     "hostname": "example.com",
2199     "port": "",
2200     "pathname": "/%7Ffp3%3Eju%3Dduvgw%3Dd",
2201     "search": "",
2202     "hash": ""
2203   },
2204   {
2205     "input": "http://example.com/@asdf%40",
2206     "base": null,
2207     "href": "http://example.com/@asdf%40",
2208     "origin": "http://example.com",
2209     "protocol": "http:",
2210     "username": "",
2211     "password": "",
2212     "host": "example.com",
2213     "hostname": "example.com",
2214     "port": "",
2215     "pathname": "/@asdf%40",
2216     "search": "",
2217     "hash": ""
2218   },
2219   {
2220     "input": "http://example.com/你好你好",
2221     "base": null,
2222     "href": "http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
2223     "origin": "http://example.com",
2224     "protocol": "http:",
2225     "username": "",
2226     "password": "",
2227     "host": "example.com",
2228     "hostname": "example.com",
2229     "port": "",
2230     "pathname": "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
2231     "search": "",
2232     "hash": ""
2233   },
2234   {
2235     "input": "http://example.com/‥/foo",
2236     "base": null,
2237     "href": "http://example.com/%E2%80%A5/foo",
2238     "origin": "http://example.com",
2239     "protocol": "http:",
2240     "username": "",
2241     "password": "",
2242     "host": "example.com",
2243     "hostname": "example.com",
2244     "port": "",
2245     "pathname": "/%E2%80%A5/foo",
2246     "search": "",
2247     "hash": ""
2248   },
2249   {
2250     "input": "http://example.com//foo",
2251     "base": null,
2252     "href": "http://example.com/%EF%BB%BF/foo",
2253     "origin": "http://example.com",
2254     "protocol": "http:",
2255     "username": "",
2256     "password": "",
2257     "host": "example.com",
2258     "hostname": "example.com",
2259     "port": "",
2260     "pathname": "/%EF%BB%BF/foo",
2261     "search": "",
2262     "hash": ""
2263   },
2264   {
2265     "input": "http://example.com/‮/foo/‭/bar",
2266     "base": null,
2267     "href": "http://example.com/%E2%80%AE/foo/%E2%80%AD/bar",
2268     "origin": "http://example.com",
2269     "protocol": "http:",
2270     "username": "",
2271     "password": "",
2272     "host": "example.com",
2273     "hostname": "example.com",
2274     "port": "",
2275     "pathname": "/%E2%80%AE/foo/%E2%80%AD/bar",
2276     "search": "",
2277     "hash": ""
2278   },
2279   "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/relative.js",
2280   {
2281     "input": "http://www.google.com/foo?bar=baz#",
2282     "base": null,
2283     "href": "http://www.google.com/foo?bar=baz#",
2284     "origin": "http://www.google.com",
2285     "protocol": "http:",
2286     "username": "",
2287     "password": "",
2288     "host": "www.google.com",
2289     "hostname": "www.google.com",
2290     "port": "",
2291     "pathname": "/foo",
2292     "search": "?bar=baz",
2293     "hash": ""
2294   },
2295   {
2296     "input": "http://www.google.com/foo?bar=baz# »",
2297     "base": null,
2298     "href": "http://www.google.com/foo?bar=baz#%20%C2%BB",
2299     "origin": "http://www.google.com",
2300     "protocol": "http:",
2301     "username": "",
2302     "password": "",
2303     "host": "www.google.com",
2304     "hostname": "www.google.com",
2305     "port": "",
2306     "pathname": "/foo",
2307     "search": "?bar=baz",
2308     "hash": "#%20%C2%BB"
2309   },
2310   {
2311     "input": "data:test# »",
2312     "base": null,
2313     "href": "data:test#%20%C2%BB",
2314     "origin": "null",
2315     "protocol": "data:",
2316     "username": "",
2317     "password": "",
2318     "host": "",
2319     "hostname": "",
2320     "port": "",
2321     "pathname": "test",
2322     "search": "",
2323     "hash": "#%20%C2%BB"
2324   },
2325   {
2326     "input": "http://www.google.com",
2327     "base": null,
2328     "href": "http://www.google.com/",
2329     "origin": "http://www.google.com",
2330     "protocol": "http:",
2331     "username": "",
2332     "password": "",
2333     "host": "www.google.com",
2334     "hostname": "www.google.com",
2335     "port": "",
2336     "pathname": "/",
2337     "search": "",
2338     "hash": ""
2339   },
2340   {
2341     "input": "http://192.0x00A80001",
2342     "base": null,
2343     "href": "http://192.168.0.1/",
2344     "origin": "http://192.168.0.1",
2345     "protocol": "http:",
2346     "username": "",
2347     "password": "",
2348     "host": "192.168.0.1",
2349     "hostname": "192.168.0.1",
2350     "port": "",
2351     "pathname": "/",
2352     "search": "",
2353     "hash": ""
2354   },
2355   {
2356     "input": "http://www/foo%2Ehtml",
2357     "base": null,
2358     "href": "http://www/foo%2Ehtml",
2359     "origin": "http://www",
2360     "protocol": "http:",
2361     "username": "",
2362     "password": "",
2363     "host": "www",
2364     "hostname": "www",
2365     "port": "",
2366     "pathname": "/foo%2Ehtml",
2367     "search": "",
2368     "hash": ""
2369   },
2370   {
2371     "input": "http://www/foo/%2E/html",
2372     "base": null,
2373     "href": "http://www/foo/html",
2374     "origin": "http://www",
2375     "protocol": "http:",
2376     "username": "",
2377     "password": "",
2378     "host": "www",
2379     "hostname": "www",
2380     "port": "",
2381     "pathname": "/foo/html",
2382     "search": "",
2383     "hash": ""
2384   },
2385   {
2386     "input": "http://user:pass@/",
2387     "base": null,
2388     "failure": true
2389   },
2390   {
2391     "input": "http://%25DOMAIN:foobar@foodomain.com/",
2392     "base": null,
2393     "href": "http://%25DOMAIN:foobar@foodomain.com/",
2394     "origin": "http://foodomain.com",
2395     "protocol": "http:",
2396     "username": "%25DOMAIN",
2397     "password": "foobar",
2398     "host": "foodomain.com",
2399     "hostname": "foodomain.com",
2400     "port": "",
2401     "pathname": "/",
2402     "search": "",
2403     "hash": ""
2404   },
2405   {
2406     "input": "http:\\\\www.google.com\\foo",
2407     "base": null,
2408     "href": "http://www.google.com/foo",
2409     "origin": "http://www.google.com",
2410     "protocol": "http:",
2411     "username": "",
2412     "password": "",
2413     "host": "www.google.com",
2414     "hostname": "www.google.com",
2415     "port": "",
2416     "pathname": "/foo",
2417     "search": "",
2418     "hash": ""
2419   },
2420   {
2421     "input": "http://foo:80/",
2422     "base": null,
2423     "href": "http://foo/",
2424     "origin": "http://foo",
2425     "protocol": "http:",
2426     "username": "",
2427     "password": "",
2428     "host": "foo",
2429     "hostname": "foo",
2430     "port": "",
2431     "pathname": "/",
2432     "search": "",
2433     "hash": ""
2434   },
2435   {
2436     "input": "http://foo:81/",
2437     "base": null,
2438     "href": "http://foo:81/",
2439     "origin": "http://foo:81",
2440     "protocol": "http:",
2441     "username": "",
2442     "password": "",
2443     "host": "foo:81",
2444     "hostname": "foo",
2445     "port": "81",
2446     "pathname": "/",
2447     "search": "",
2448     "hash": ""
2449   },
2450   {
2451     "input": "httpa://foo:80/",
2452     "base": null,
2453     "href": "httpa://foo:80/",
2454     "origin": "null",
2455     "protocol": "httpa:",
2456     "username": "",
2457     "password": "",
2458     "host": "foo:80",
2459     "hostname": "foo",
2460     "port": "80",
2461     "pathname": "/",
2462     "search": "",
2463     "hash": ""
2464   },
2465   {
2466     "input": "http://foo:-80/",
2467     "base": null,
2468     "failure": true
2469   },
2470   {
2471     "input": "https://foo:443/",
2472     "base": null,
2473     "href": "https://foo/",
2474     "origin": "https://foo",
2475     "protocol": "https:",
2476     "username": "",
2477     "password": "",
2478     "host": "foo",
2479     "hostname": "foo",
2480     "port": "",
2481     "pathname": "/",
2482     "search": "",
2483     "hash": ""
2484   },
2485   {
2486     "input": "https://foo:80/",
2487     "base": null,
2488     "href": "https://foo:80/",
2489     "origin": "https://foo:80",
2490     "protocol": "https:",
2491     "username": "",
2492     "password": "",
2493     "host": "foo:80",
2494     "hostname": "foo",
2495     "port": "80",
2496     "pathname": "/",
2497     "search": "",
2498     "hash": ""
2499   },
2500   {
2501     "input": "ftp://foo:21/",
2502     "base": null,
2503     "href": "ftp://foo/",
2504     "origin": "ftp://foo",
2505     "protocol": "ftp:",
2506     "username": "",
2507     "password": "",
2508     "host": "foo",
2509     "hostname": "foo",
2510     "port": "",
2511     "pathname": "/",
2512     "search": "",
2513     "hash": ""
2514   },
2515   {
2516     "input": "ftp://foo:80/",
2517     "base": null,
2518     "href": "ftp://foo:80/",
2519     "origin": "ftp://foo:80",
2520     "protocol": "ftp:",
2521     "username": "",
2522     "password": "",
2523     "host": "foo:80",
2524     "hostname": "foo",
2525     "port": "80",
2526     "pathname": "/",
2527     "search": "",
2528     "hash": ""
2529   },
2530   {
2531     "input": "gopher://foo:70/",
2532     "base": null,
2533     "href": "gopher://foo:70/",
2534     "origin": "null",
2535     "protocol": "gopher:",
2536     "username": "",
2537     "password": "",
2538     "host": "foo:70",
2539     "hostname": "foo",
2540     "port": "70",
2541     "pathname": "/",
2542     "search": "",
2543     "hash": ""
2544   },
2545   {
2546     "input": "gopher://foo:443/",
2547     "base": null,
2548     "href": "gopher://foo:443/",
2549     "origin": "null",
2550     "protocol": "gopher:",
2551     "username": "",
2552     "password": "",
2553     "host": "foo:443",
2554     "hostname": "foo",
2555     "port": "443",
2556     "pathname": "/",
2557     "search": "",
2558     "hash": ""
2559   },
2560   {
2561     "input": "ws://foo:80/",
2562     "base": null,
2563     "href": "ws://foo/",
2564     "origin": "ws://foo",
2565     "protocol": "ws:",
2566     "username": "",
2567     "password": "",
2568     "host": "foo",
2569     "hostname": "foo",
2570     "port": "",
2571     "pathname": "/",
2572     "search": "",
2573     "hash": ""
2574   },
2575   {
2576     "input": "ws://foo:81/",
2577     "base": null,
2578     "href": "ws://foo:81/",
2579     "origin": "ws://foo:81",
2580     "protocol": "ws:",
2581     "username": "",
2582     "password": "",
2583     "host": "foo:81",
2584     "hostname": "foo",
2585     "port": "81",
2586     "pathname": "/",
2587     "search": "",
2588     "hash": ""
2589   },
2590   {
2591     "input": "ws://foo:443/",
2592     "base": null,
2593     "href": "ws://foo:443/",
2594     "origin": "ws://foo:443",
2595     "protocol": "ws:",
2596     "username": "",
2597     "password": "",
2598     "host": "foo:443",
2599     "hostname": "foo",
2600     "port": "443",
2601     "pathname": "/",
2602     "search": "",
2603     "hash": ""
2604   },
2605   {
2606     "input": "ws://foo:815/",
2607     "base": null,
2608     "href": "ws://foo:815/",
2609     "origin": "ws://foo:815",
2610     "protocol": "ws:",
2611     "username": "",
2612     "password": "",
2613     "host": "foo:815",
2614     "hostname": "foo",
2615     "port": "815",
2616     "pathname": "/",
2617     "search": "",
2618     "hash": ""
2619   },
2620   {
2621     "input": "wss://foo:80/",
2622     "base": null,
2623     "href": "wss://foo:80/",
2624     "origin": "wss://foo:80",
2625     "protocol": "wss:",
2626     "username": "",
2627     "password": "",
2628     "host": "foo:80",
2629     "hostname": "foo",
2630     "port": "80",
2631     "pathname": "/",
2632     "search": "",
2633     "hash": ""
2634   },
2635   {
2636     "input": "wss://foo:81/",
2637     "base": null,
2638     "href": "wss://foo:81/",
2639     "origin": "wss://foo:81",
2640     "protocol": "wss:",
2641     "username": "",
2642     "password": "",
2643     "host": "foo:81",
2644     "hostname": "foo",
2645     "port": "81",
2646     "pathname": "/",
2647     "search": "",
2648     "hash": ""
2649   },
2650   {
2651     "input": "wss://foo:443/",
2652     "base": null,
2653     "href": "wss://foo/",
2654     "origin": "wss://foo",
2655     "protocol": "wss:",
2656     "username": "",
2657     "password": "",
2658     "host": "foo",
2659     "hostname": "foo",
2660     "port": "",
2661     "pathname": "/",
2662     "search": "",
2663     "hash": ""
2664   },
2665   {
2666     "input": "wss://foo:815/",
2667     "base": null,
2668     "href": "wss://foo:815/",
2669     "origin": "wss://foo:815",
2670     "protocol": "wss:",
2671     "username": "",
2672     "password": "",
2673     "host": "foo:815",
2674     "hostname": "foo",
2675     "port": "815",
2676     "pathname": "/",
2677     "search": "",
2678     "hash": ""
2679   },
2680   {
2681     "input": "ftp:/example.com/",
2682     "base": null,
2683     "href": "ftp://example.com/",
2684     "origin": "ftp://example.com",
2685     "protocol": "ftp:",
2686     "username": "",
2687     "password": "",
2688     "host": "example.com",
2689     "hostname": "example.com",
2690     "port": "",
2691     "pathname": "/",
2692     "search": "",
2693     "hash": ""
2694   },
2695   {
2696     "input": "https:/example.com/",
2697     "base": null,
2698     "href": "https://example.com/",
2699     "origin": "https://example.com",
2700     "protocol": "https:",
2701     "username": "",
2702     "password": "",
2703     "host": "example.com",
2704     "hostname": "example.com",
2705     "port": "",
2706     "pathname": "/",
2707     "search": "",
2708     "hash": ""
2709   },
2710   {
2711     "input": "madeupscheme:/example.com/",
2712     "base": null,
2713     "href": "madeupscheme:/example.com/",
2714     "origin": "null",
2715     "protocol": "madeupscheme:",
2716     "username": "",
2717     "password": "",
2718     "host": "",
2719     "hostname": "",
2720     "port": "",
2721     "pathname": "/example.com/",
2722     "search": "",
2723     "hash": ""
2724   },
2725   {
2726     "input": "file:/example.com/",
2727     "base": null,
2728     "href": "file:///example.com/",
2729     "protocol": "file:",
2730     "username": "",
2731     "password": "",
2732     "host": "",
2733     "hostname": "",
2734     "port": "",
2735     "pathname": "/example.com/",
2736     "search": "",
2737     "hash": ""
2738   },
2739   {
2740     "input": "ftps:/example.com/",
2741     "base": null,
2742     "href": "ftps:/example.com/",
2743     "origin": "null",
2744     "protocol": "ftps:",
2745     "username": "",
2746     "password": "",
2747     "host": "",
2748     "hostname": "",
2749     "port": "",
2750     "pathname": "/example.com/",
2751     "search": "",
2752     "hash": ""
2753   },
2754   {
2755     "input": "gopher:/example.com/",
2756     "base": null,
2757     "href": "gopher:/example.com/",
2758     "origin": "null",
2759     "protocol": "gopher:",
2760     "username": "",
2761     "password": "",
2762     "host": "",
2763     "hostname": "",
2764     "port": "",
2765     "pathname": "/example.com/",
2766     "search": "",
2767     "hash": ""
2768   },
2769   {
2770     "input": "ws:/example.com/",
2771     "base": null,
2772     "href": "ws://example.com/",
2773     "origin": "ws://example.com",
2774     "protocol": "ws:",
2775     "username": "",
2776     "password": "",
2777     "host": "example.com",
2778     "hostname": "example.com",
2779     "port": "",
2780     "pathname": "/",
2781     "search": "",
2782     "hash": ""
2783   },
2784   {
2785     "input": "wss:/example.com/",
2786     "base": null,
2787     "href": "wss://example.com/",
2788     "origin": "wss://example.com",
2789     "protocol": "wss:",
2790     "username": "",
2791     "password": "",
2792     "host": "example.com",
2793     "hostname": "example.com",
2794     "port": "",
2795     "pathname": "/",
2796     "search": "",
2797     "hash": ""
2798   },
2799   {
2800     "input": "data:/example.com/",
2801     "base": null,
2802     "href": "data:/example.com/",
2803     "origin": "null",
2804     "protocol": "data:",
2805     "username": "",
2806     "password": "",
2807     "host": "",
2808     "hostname": "",
2809     "port": "",
2810     "pathname": "/example.com/",
2811     "search": "",
2812     "hash": ""
2813   },
2814   {
2815     "input": "javascript:/example.com/",
2816     "base": null,
2817     "href": "javascript:/example.com/",
2818     "origin": "null",
2819     "protocol": "javascript:",
2820     "username": "",
2821     "password": "",
2822     "host": "",
2823     "hostname": "",
2824     "port": "",
2825     "pathname": "/example.com/",
2826     "search": "",
2827     "hash": ""
2828   },
2829   {
2830     "input": "mailto:/example.com/",
2831     "base": null,
2832     "href": "mailto:/example.com/",
2833     "origin": "null",
2834     "protocol": "mailto:",
2835     "username": "",
2836     "password": "",
2837     "host": "",
2838     "hostname": "",
2839     "port": "",
2840     "pathname": "/example.com/",
2841     "search": "",
2842     "hash": ""
2843   },
2844   {
2845     "input": "ftp:example.com/",
2846     "base": null,
2847     "href": "ftp://example.com/",
2848     "origin": "ftp://example.com",
2849     "protocol": "ftp:",
2850     "username": "",
2851     "password": "",
2852     "host": "example.com",
2853     "hostname": "example.com",
2854     "port": "",
2855     "pathname": "/",
2856     "search": "",
2857     "hash": ""
2858   },
2859   {
2860     "input": "https:example.com/",
2861     "base": null,
2862     "href": "https://example.com/",
2863     "origin": "https://example.com",
2864     "protocol": "https:",
2865     "username": "",
2866     "password": "",
2867     "host": "example.com",
2868     "hostname": "example.com",
2869     "port": "",
2870     "pathname": "/",
2871     "search": "",
2872     "hash": ""
2873   },
2874   {
2875     "input": "madeupscheme:example.com/",
2876     "base": null,
2877     "href": "madeupscheme:example.com/",
2878     "origin": "null",
2879     "protocol": "madeupscheme:",
2880     "username": "",
2881     "password": "",
2882     "host": "",
2883     "hostname": "",
2884     "port": "",
2885     "pathname": "example.com/",
2886     "search": "",
2887     "hash": ""
2888   },
2889   {
2890     "input": "ftps:example.com/",
2891     "base": null,
2892     "href": "ftps:example.com/",
2893     "origin": "null",
2894     "protocol": "ftps:",
2895     "username": "",
2896     "password": "",
2897     "host": "",
2898     "hostname": "",
2899     "port": "",
2900     "pathname": "example.com/",
2901     "search": "",
2902     "hash": ""
2903   },
2904   {
2905     "input": "gopher:example.com/",
2906     "base": null,
2907     "href": "gopher:example.com/",
2908     "origin": "null",
2909     "protocol": "gopher:",
2910     "username": "",
2911     "password": "",
2912     "host": "",
2913     "hostname": "",
2914     "port": "",
2915     "pathname": "example.com/",
2916     "search": "",
2917     "hash": ""
2918   },
2919   {
2920     "input": "ws:example.com/",
2921     "base": null,
2922     "href": "ws://example.com/",
2923     "origin": "ws://example.com",
2924     "protocol": "ws:",
2925     "username": "",
2926     "password": "",
2927     "host": "example.com",
2928     "hostname": "example.com",
2929     "port": "",
2930     "pathname": "/",
2931     "search": "",
2932     "hash": ""
2933   },
2934   {
2935     "input": "wss:example.com/",
2936     "base": null,
2937     "href": "wss://example.com/",
2938     "origin": "wss://example.com",
2939     "protocol": "wss:",
2940     "username": "",
2941     "password": "",
2942     "host": "example.com",
2943     "hostname": "example.com",
2944     "port": "",
2945     "pathname": "/",
2946     "search": "",
2947     "hash": ""
2948   },
2949   {
2950     "input": "data:example.com/",
2951     "base": null,
2952     "href": "data:example.com/",
2953     "origin": "null",
2954     "protocol": "data:",
2955     "username": "",
2956     "password": "",
2957     "host": "",
2958     "hostname": "",
2959     "port": "",
2960     "pathname": "example.com/",
2961     "search": "",
2962     "hash": ""
2963   },
2964   {
2965     "input": "javascript:example.com/",
2966     "base": null,
2967     "href": "javascript:example.com/",
2968     "origin": "null",
2969     "protocol": "javascript:",
2970     "username": "",
2971     "password": "",
2972     "host": "",
2973     "hostname": "",
2974     "port": "",
2975     "pathname": "example.com/",
2976     "search": "",
2977     "hash": ""
2978   },
2979   {
2980     "input": "mailto:example.com/",
2981     "base": null,
2982     "href": "mailto:example.com/",
2983     "origin": "null",
2984     "protocol": "mailto:",
2985     "username": "",
2986     "password": "",
2987     "host": "",
2988     "hostname": "",
2989     "port": "",
2990     "pathname": "example.com/",
2991     "search": "",
2992     "hash": ""
2993   },
2994   {
2995     "input": "http://@www.example.com",
2996     "base": null,
2997     "href": "http://www.example.com/",
2998     "origin": "http://www.example.com",
2999     "protocol": "http:",
3000     "username": "",
3001     "password": "",
3002     "host": "www.example.com",
3003     "hostname": "www.example.com",
3004     "port": "",
3005     "pathname": "/",
3006     "search": "",
3007     "hash": ""
3008   },
3009   {
3010     "input": "http://a:b@www.example.com",
3011     "base": null,
3012     "href": "http://a:b@www.example.com/",
3013     "origin": "http://www.example.com",
3014     "protocol": "http:",
3015     "username": "a",
3016     "password": "b",
3017     "host": "www.example.com",
3018     "hostname": "www.example.com",
3019     "port": "",
3020     "pathname": "/",
3021     "search": "",
3022     "hash": ""
3023   },
3024   {
3025     "input": "http://@pple.com",
3026     "base": null,
3027     "href": "http://pple.com/",
3028     "origin": "http://pple.com",
3029     "protocol": "http:",
3030     "username": "",
3031     "password": "",
3032     "host": "pple.com",
3033     "hostname": "pple.com",
3034     "port": "",
3035     "pathname": "/",
3036     "search": "",
3037     "hash": ""
3038   },
3039   {
3040     "input": "http://:b@www.example.com",
3041     "base": null,
3042     "href": "http://:b@www.example.com/",
3043     "origin": "http://www.example.com",
3044     "protocol": "http:",
3045     "username": "",
3046     "password": "b",
3047     "host": "www.example.com",
3048     "hostname": "www.example.com",
3049     "port": "",
3050     "pathname": "/",
3051     "search": "",
3052     "hash": ""
3053   },
3054   {
3055     "input": "http:/:@/www.example.com",
3056     "base": null,
3057     "failure": true,
3058     "relativeTo": "non-opaque-path-base"
3059   },
3060   {
3061     "input": "http://user@/www.example.com",
3062     "base": null,
3063     "failure": true
3064   },
3065   {
3066     "input": "http:@/www.example.com",
3067     "base": null,
3068     "failure": true,
3069     "relativeTo": "non-opaque-path-base"
3070   },
3071   {
3072     "input": "http:/@/www.example.com",
3073     "base": null,
3074     "failure": true,
3075     "relativeTo": "non-opaque-path-base"
3076   },
3077   {
3078     "input": "http://@/www.example.com",
3079     "base": null,
3080     "failure": true
3081   },
3082   {
3083     "input": "https:@/www.example.com",
3084     "base": null,
3085     "failure": true,
3086     "relativeTo": "non-opaque-path-base"
3087   },
3088   {
3089     "input": "http:a:b@/www.example.com",
3090     "base": null,
3091     "failure": true,
3092     "relativeTo": "non-opaque-path-base"
3093   },
3094   {
3095     "input": "http:/a:b@/www.example.com",
3096     "base": null,
3097     "failure": true,
3098     "relativeTo": "non-opaque-path-base"
3099   },
3100   {
3101     "input": "http://a:b@/www.example.com",
3102     "base": null,
3103     "failure": true
3104   },
3105   {
3106     "input": "http::@/www.example.com",
3107     "base": null,
3108     "failure": true,
3109     "relativeTo": "non-opaque-path-base"
3110   },
3111   {
3112     "input": "http://a:@www.example.com",
3113     "base": null,
3114     "href": "http://a@www.example.com/",
3115     "origin": "http://www.example.com",
3116     "protocol": "http:",
3117     "username": "a",
3118     "password": "",
3119     "host": "www.example.com",
3120     "hostname": "www.example.com",
3121     "port": "",
3122     "pathname": "/",
3123     "search": "",
3124     "hash": ""
3125   },
3126   {
3127     "input": "http://www.@pple.com",
3128     "base": null,
3129     "href": "http://www.@pple.com/",
3130     "origin": "http://pple.com",
3131     "protocol": "http:",
3132     "username": "www.",
3133     "password": "",
3134     "host": "pple.com",
3135     "hostname": "pple.com",
3136     "port": "",
3137     "pathname": "/",
3138     "search": "",
3139     "hash": ""
3140   },
3141   {
3142     "input": "http:@:www.example.com",
3143     "base": null,
3144     "failure": true,
3145     "relativeTo": "non-opaque-path-base"
3146   },
3147   {
3148     "input": "http:/@:www.example.com",
3149     "base": null,
3150     "failure": true,
3151     "relativeTo": "non-opaque-path-base"
3152   },
3153   {
3154     "input": "http://@:www.example.com",
3155     "base": null,
3156     "failure": true
3157   },
3158   {
3159     "input": "http://:@www.example.com",
3160     "base": null,
3161     "href": "http://www.example.com/",
3162     "origin": "http://www.example.com",
3163     "protocol": "http:",
3164     "username": "",
3165     "password": "",
3166     "host": "www.example.com",
3167     "hostname": "www.example.com",
3168     "port": "",
3169     "pathname": "/",
3170     "search": "",
3171     "hash": ""
3172   },
3173   "# Others",
3174   {
3175     "input": "/",
3176     "base": "http://www.example.com/test",
3177     "href": "http://www.example.com/",
3178     "origin": "http://www.example.com",
3179     "protocol": "http:",
3180     "username": "",
3181     "password": "",
3182     "host": "www.example.com",
3183     "hostname": "www.example.com",
3184     "port": "",
3185     "pathname": "/",
3186     "search": "",
3187     "hash": ""
3188   },
3189   {
3190     "input": "/test.txt",
3191     "base": "http://www.example.com/test",
3192     "href": "http://www.example.com/test.txt",
3193     "origin": "http://www.example.com",
3194     "protocol": "http:",
3195     "username": "",
3196     "password": "",
3197     "host": "www.example.com",
3198     "hostname": "www.example.com",
3199     "port": "",
3200     "pathname": "/test.txt",
3201     "search": "",
3202     "hash": ""
3203   },
3204   {
3205     "input": ".",
3206     "base": "http://www.example.com/test",
3207     "href": "http://www.example.com/",
3208     "origin": "http://www.example.com",
3209     "protocol": "http:",
3210     "username": "",
3211     "password": "",
3212     "host": "www.example.com",
3213     "hostname": "www.example.com",
3214     "port": "",
3215     "pathname": "/",
3216     "search": "",
3217     "hash": ""
3218   },
3219   {
3220     "input": "..",
3221     "base": "http://www.example.com/test",
3222     "href": "http://www.example.com/",
3223     "origin": "http://www.example.com",
3224     "protocol": "http:",
3225     "username": "",
3226     "password": "",
3227     "host": "www.example.com",
3228     "hostname": "www.example.com",
3229     "port": "",
3230     "pathname": "/",
3231     "search": "",
3232     "hash": ""
3233   },
3234   {
3235     "input": "test.txt",
3236     "base": "http://www.example.com/test",
3237     "href": "http://www.example.com/test.txt",
3238     "origin": "http://www.example.com",
3239     "protocol": "http:",
3240     "username": "",
3241     "password": "",
3242     "host": "www.example.com",
3243     "hostname": "www.example.com",
3244     "port": "",
3245     "pathname": "/test.txt",
3246     "search": "",
3247     "hash": ""
3248   },
3249   {
3250     "input": "./test.txt",
3251     "base": "http://www.example.com/test",
3252     "href": "http://www.example.com/test.txt",
3253     "origin": "http://www.example.com",
3254     "protocol": "http:",
3255     "username": "",
3256     "password": "",
3257     "host": "www.example.com",
3258     "hostname": "www.example.com",
3259     "port": "",
3260     "pathname": "/test.txt",
3261     "search": "",
3262     "hash": ""
3263   },
3264   {
3265     "input": "../test.txt",
3266     "base": "http://www.example.com/test",
3267     "href": "http://www.example.com/test.txt",
3268     "origin": "http://www.example.com",
3269     "protocol": "http:",
3270     "username": "",
3271     "password": "",
3272     "host": "www.example.com",
3273     "hostname": "www.example.com",
3274     "port": "",
3275     "pathname": "/test.txt",
3276     "search": "",
3277     "hash": ""
3278   },
3279   {
3280     "input": "../aaa/test.txt",
3281     "base": "http://www.example.com/test",
3282     "href": "http://www.example.com/aaa/test.txt",
3283     "origin": "http://www.example.com",
3284     "protocol": "http:",
3285     "username": "",
3286     "password": "",
3287     "host": "www.example.com",
3288     "hostname": "www.example.com",
3289     "port": "",
3290     "pathname": "/aaa/test.txt",
3291     "search": "",
3292     "hash": ""
3293   },
3294   {
3295     "input": "../../test.txt",
3296     "base": "http://www.example.com/test",
3297     "href": "http://www.example.com/test.txt",
3298     "origin": "http://www.example.com",
3299     "protocol": "http:",
3300     "username": "",
3301     "password": "",
3302     "host": "www.example.com",
3303     "hostname": "www.example.com",
3304     "port": "",
3305     "pathname": "/test.txt",
3306     "search": "",
3307     "hash": ""
3308   },
3309   {
3310     "input": "中/test.txt",
3311     "base": "http://www.example.com/test",
3312     "href": "http://www.example.com/%E4%B8%AD/test.txt",
3313     "origin": "http://www.example.com",
3314     "protocol": "http:",
3315     "username": "",
3316     "password": "",
3317     "host": "www.example.com",
3318     "hostname": "www.example.com",
3319     "port": "",
3320     "pathname": "/%E4%B8%AD/test.txt",
3321     "search": "",
3322     "hash": ""
3323   },
3324   {
3325     "input": "http://www.example2.com",
3326     "base": "http://www.example.com/test",
3327     "href": "http://www.example2.com/",
3328     "origin": "http://www.example2.com",
3329     "protocol": "http:",
3330     "username": "",
3331     "password": "",
3332     "host": "www.example2.com",
3333     "hostname": "www.example2.com",
3334     "port": "",
3335     "pathname": "/",
3336     "search": "",
3337     "hash": ""
3338   },
3339   {
3340     "input": "//www.example2.com",
3341     "base": "http://www.example.com/test",
3342     "href": "http://www.example2.com/",
3343     "origin": "http://www.example2.com",
3344     "protocol": "http:",
3345     "username": "",
3346     "password": "",
3347     "host": "www.example2.com",
3348     "hostname": "www.example2.com",
3349     "port": "",
3350     "pathname": "/",
3351     "search": "",
3352     "hash": ""
3353   },
3354   {
3355     "input": "file:...",
3356     "base": "http://www.example.com/test",
3357     "href": "file:///...",
3358     "protocol": "file:",
3359     "username": "",
3360     "password": "",
3361     "host": "",
3362     "hostname": "",
3363     "port": "",
3364     "pathname": "/...",
3365     "search": "",
3366     "hash": ""
3367   },
3368   {
3369     "input": "file:..",
3370     "base": "http://www.example.com/test",
3371     "href": "file:///",
3372     "protocol": "file:",
3373     "username": "",
3374     "password": "",
3375     "host": "",
3376     "hostname": "",
3377     "port": "",
3378     "pathname": "/",
3379     "search": "",
3380     "hash": ""
3381   },
3382   {
3383     "input": "file:a",
3384     "base": "http://www.example.com/test",
3385     "href": "file:///a",
3386     "protocol": "file:",
3387     "username": "",
3388     "password": "",
3389     "host": "",
3390     "hostname": "",
3391     "port": "",
3392     "pathname": "/a",
3393     "search": "",
3394     "hash": ""
3395   },
3396   "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/host.html",
3397   "Basic canonicalization, uppercase should be converted to lowercase",
3398   {
3399     "input": "http://ExAmPlE.CoM",
3400     "base": "http://other.com/",
3401     "href": "http://example.com/",
3402     "origin": "http://example.com",
3403     "protocol": "http:",
3404     "username": "",
3405     "password": "",
3406     "host": "example.com",
3407     "hostname": "example.com",
3408     "port": "",
3409     "pathname": "/",
3410     "search": "",
3411     "hash": ""
3412   },
3413   {
3414     "input": "http://example example.com",
3415     "base": "http://other.com/",
3416     "failure": true
3417   },
3418   {
3419     "input": "http://Goo%20 goo%7C|.com",
3420     "base": "http://other.com/",
3421     "failure": true
3422   },
3423   {
3424     "input": "http://[]",
3425     "base": "http://other.com/",
3426     "failure": true
3427   },
3428   {
3429     "input": "http://[:]",
3430     "base": "http://other.com/",
3431     "failure": true
3432   },
3433   "U+3000 is mapped to U+0020 (space) which is disallowed",
3434   {
3435     "input": "http://GOO\u00a0\u3000goo.com",
3436     "base": "http://other.com/",
3437     "failure": true
3438   },
3439   "Other types of space (no-break, zero-width, zero-width-no-break) are name-prepped away to nothing. U+200B, U+2060, and U+FEFF, are ignored",
3440   {
3441     "input": "http://GOO\u200b\u2060\ufeffgoo.com",
3442     "base": "http://other.com/",
3443     "href": "http://googoo.com/",
3444     "origin": "http://googoo.com",
3445     "protocol": "http:",
3446     "username": "",
3447     "password": "",
3448     "host": "googoo.com",
3449     "hostname": "googoo.com",
3450     "port": "",
3451     "pathname": "/",
3452     "search": "",
3453     "hash": ""
3454   },
3455   "Leading and trailing C0 control or space",
3456   {
3457     "input": "\u0000\u001b\u0004\u0012 http://example.com/\u001f \u000d ",
3458     "base": null,
3459     "href": "http://example.com/",
3460     "origin": "http://example.com",
3461     "protocol": "http:",
3462     "username": "",
3463     "password": "",
3464     "host": "example.com",
3465     "hostname": "example.com",
3466     "port": "",
3467     "pathname": "/",
3468     "search": "",
3469     "hash": ""
3470   },
3471   "Ideographic full stop (full-width period for Chinese, etc.) should be treated as a dot. U+3002 is mapped to U+002E (dot)",
3472   {
3473     "input": "http://www.foo。bar.com",
3474     "base": "http://other.com/",
3475     "href": "http://www.foo.bar.com/",
3476     "origin": "http://www.foo.bar.com",
3477     "protocol": "http:",
3478     "username": "",
3479     "password": "",
3480     "host": "www.foo.bar.com",
3481     "hostname": "www.foo.bar.com",
3482     "port": "",
3483     "pathname": "/",
3484     "search": "",
3485     "hash": ""
3486   },
3487   "Invalid unicode characters should fail... U+FDD0 is disallowed; %ef%b7%90 is U+FDD0",
3488   {
3489     "input": "http://\ufdd0zyx.com",
3490     "base": "http://other.com/",
3491     "failure": true
3492   },
3493   "This is the same as previous but escaped",
3494   {
3495     "input": "http://%ef%b7%90zyx.com",
3496     "base": "http://other.com/",
3497     "failure": true
3498   },
3499   "U+FFFD",
3500   {
3501     "input": "https://\ufffd",
3502     "base": null,
3503     "failure": true
3504   },
3505   {
3506     "input": "https://%EF%BF%BD",
3507     "base": null,
3508     "failure": true
3509   },
3510   {
3511     "input": "https://x/\ufffd?\ufffd#\ufffd",
3512     "base": null,
3513     "href": "https://x/%EF%BF%BD?%EF%BF%BD#%EF%BF%BD",
3514     "origin": "https://x",
3515     "protocol": "https:",
3516     "username": "",
3517     "password": "",
3518     "host": "x",
3519     "hostname": "x",
3520     "port": "",
3521     "pathname": "/%EF%BF%BD",
3522     "search": "?%EF%BF%BD",
3523     "hash": "#%EF%BF%BD"
3524   },
3525   "Domain is ASCII, but a label is invalid IDNA",
3526   {
3527     "input": "http://a.b.c.xn--pokxncvks",
3528     "base": null,
3529     "failure": true
3530   },
3531   {
3532     "input": "http://10.0.0.xn--pokxncvks",
3533     "base": null,
3534     "failure": true
3535   },
3536   "IDNA labels should be matched case-insensitively",
3537   {
3538     "input": "http://a.b.c.XN--pokxncvks",
3539     "base": null,
3540     "failure": true
3541   },
3542   {
3543     "input": "http://a.b.c.Xn--pokxncvks",
3544     "base": null,
3545     "failure": true
3546   },
3547   {
3548     "input": "http://10.0.0.XN--pokxncvks",
3549     "base": null,
3550     "failure": true
3551   },
3552   {
3553     "input": "http://10.0.0.xN--pokxncvks",
3554     "base": null,
3555     "failure": true
3556   },
3557   "Test name prepping, fullwidth input should be converted to ASCII and NOT IDN-ized. This is 'Go' in fullwidth UTF-8/UTF-16.",
3558   {
3559     "input": "http://Go.com",
3560     "base": "http://other.com/",
3561     "href": "http://go.com/",
3562     "origin": "http://go.com",
3563     "protocol": "http:",
3564     "username": "",
3565     "password": "",
3566     "host": "go.com",
3567     "hostname": "go.com",
3568     "port": "",
3569     "pathname": "/",
3570     "search": "",
3571     "hash": ""
3572   },
3573   "URL spec forbids the following. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24257",
3574   {
3575     "input": "http://%41.com",
3576     "base": "http://other.com/",
3577     "failure": true
3578   },
3579   {
3580     "input": "http://%ef%bc%85%ef%bc%94%ef%bc%91.com",
3581     "base": "http://other.com/",
3582     "failure": true
3583   },
3584   "...%00 in fullwidth should fail (also as escaped UTF-8 input)",
3585   {
3586     "input": "http://%00.com",
3587     "base": "http://other.com/",
3588     "failure": true
3589   },
3590   {
3591     "input": "http://%ef%bc%85%ef%bc%90%ef%bc%90.com",
3592     "base": "http://other.com/",
3593     "failure": true
3594   },
3595   "Basic IDN support, UTF-8 and UTF-16 input should be converted to IDN",
3596   {
3597     "input": "http://你好你好",
3598     "base": "http://other.com/",
3599     "href": "http://xn--6qqa088eba/",
3600     "origin": "http://xn--6qqa088eba",
3601     "protocol": "http:",
3602     "username": "",
3603     "password": "",
3604     "host": "xn--6qqa088eba",
3605     "hostname": "xn--6qqa088eba",
3606     "port": "",
3607     "pathname": "/",
3608     "search": "",
3609     "hash": ""
3610   },
3611   {
3612     "input": "https://faß.ExAmPlE/",
3613     "base": null,
3614     "href": "https://xn--fa-hia.example/",
3615     "origin": "https://xn--fa-hia.example",
3616     "protocol": "https:",
3617     "username": "",
3618     "password": "",
3619     "host": "xn--fa-hia.example",
3620     "hostname": "xn--fa-hia.example",
3621     "port": "",
3622     "pathname": "/",
3623     "search": "",
3624     "hash": ""
3625   },
3626   {
3627     "input": "sc://faß.ExAmPlE/",
3628     "base": null,
3629     "href": "sc://fa%C3%9F.ExAmPlE/",
3630     "origin": "null",
3631     "protocol": "sc:",
3632     "username": "",
3633     "password": "",
3634     "host": "fa%C3%9F.ExAmPlE",
3635     "hostname": "fa%C3%9F.ExAmPlE",
3636     "port": "",
3637     "pathname": "/",
3638     "search": "",
3639     "hash": ""
3640   },
3641   "Invalid escaped characters should fail and the percents should be escaped. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24191",
3642   {
3643     "input": "http://%zz%66%a.com",
3644     "base": "http://other.com/",
3645     "failure": true
3646   },
3647   "If we get an invalid character that has been escaped.",
3648   {
3649     "input": "http://%25",
3650     "base": "http://other.com/",
3651     "failure": true
3652   },
3653   {
3654     "input": "http://hello%00",
3655     "base": "http://other.com/",
3656     "failure": true
3657   },
3658   "Escaped numbers should be treated like IP addresses if they are.",
3659   {
3660     "input": "http://%30%78%63%30%2e%30%32%35%30.01",
3661     "base": "http://other.com/",
3662     "href": "http://192.168.0.1/",
3663     "origin": "http://192.168.0.1",
3664     "protocol": "http:",
3665     "username": "",
3666     "password": "",
3667     "host": "192.168.0.1",
3668     "hostname": "192.168.0.1",
3669     "port": "",
3670     "pathname": "/",
3671     "search": "",
3672     "hash": ""
3673   },
3674   {
3675     "input": "http://%30%78%63%30%2e%30%32%35%30.01%2e",
3676     "base": "http://other.com/",
3677     "href": "http://192.168.0.1/",
3678     "origin": "http://192.168.0.1",
3679     "protocol": "http:",
3680     "username": "",
3681     "password": "",
3682     "host": "192.168.0.1",
3683     "hostname": "192.168.0.1",
3684     "port": "",
3685     "pathname": "/",
3686     "search": "",
3687     "hash": ""
3688   },
3689   {
3690     "input": "http://192.168.0.257",
3691     "base": "http://other.com/",
3692     "failure": true
3693   },
3694   "Invalid escaping in hosts causes failure",
3695   {
3696     "input": "http://%3g%78%63%30%2e%30%32%35%30%2E.01",
3697     "base": "http://other.com/",
3698     "failure": true
3699   },
3700   "A space in a host causes failure",
3701   {
3702     "input": "http://192.168.0.1 hello",
3703     "base": "http://other.com/",
3704     "failure": true
3705   },
3706   {
3707     "input": "https://x x:12",
3708     "base": null,
3709     "failure": true
3710   },
3711   "Fullwidth and escaped UTF-8 fullwidth should still be treated as IP",
3712   {
3713     "input": "http://0Xc0.0250.01",
3714     "base": "http://other.com/",
3715     "href": "http://192.168.0.1/",
3716     "origin": "http://192.168.0.1",
3717     "protocol": "http:",
3718     "username": "",
3719     "password": "",
3720     "host": "192.168.0.1",
3721     "hostname": "192.168.0.1",
3722     "port": "",
3723     "pathname": "/",
3724     "search": "",
3725     "hash": ""
3726   },
3727   "Domains with empty labels",
3728   {
3729     "input": "http://./",
3730     "base": null,
3731     "href": "http://./",
3732     "origin": "http://.",
3733     "protocol": "http:",
3734     "username": "",
3735     "password": "",
3736     "host": ".",
3737     "hostname": ".",
3738     "port": "",
3739     "pathname": "/",
3740     "search": "",
3741     "hash": ""
3742   },
3743   {
3744     "input": "http://../",
3745     "base": null,
3746     "href": "http://../",
3747     "origin": "http://..",
3748     "protocol": "http:",
3749     "username": "",
3750     "password": "",
3751     "host": "..",
3752     "hostname": "..",
3753     "port": "",
3754     "pathname": "/",
3755     "search": "",
3756     "hash": ""
3757   },
3758   "Non-special domains with empty labels",
3759   {
3760     "input": "h://.",
3761     "base": null,
3762     "href": "h://.",
3763     "origin": "null",
3764     "protocol": "h:",
3765     "username": "",
3766     "password": "",
3767     "host": ".",
3768     "hostname": ".",
3769     "port": "",
3770     "pathname": "",
3771     "search": "",
3772     "hash": ""
3773   },
3774   "Broken IPv6",
3775   {
3776     "input": "http://[www.google.com]/",
3777     "base": null,
3778     "failure": true
3779   },
3780   {
3781     "input": "http://[google.com]",
3782     "base": "http://other.com/",
3783     "failure": true
3784   },
3785   {
3786     "input": "http://[::1.2.3.4x]",
3787     "base": "http://other.com/",
3788     "failure": true
3789   },
3790   {
3791     "input": "http://[::1.2.3.]",
3792     "base": "http://other.com/",
3793     "failure": true
3794   },
3795   {
3796     "input": "http://[::1.2.]",
3797     "base": "http://other.com/",
3798     "failure": true
3799   },
3800   {
3801     "input": "http://[::.1.2]",
3802     "base": "http://other.com/",
3803     "failure": true
3804   },
3805   {
3806     "input": "http://[::1.]",
3807     "base": "http://other.com/",
3808     "failure": true
3809   },
3810   {
3811     "input": "http://[::.1]",
3812     "base": "http://other.com/",
3813     "failure": true
3814   },
3815   {
3816     "input": "http://[::%31]",
3817     "base": "http://other.com/",
3818     "failure": true
3819   },
3820   {
3821     "input": "http://%5B::1]",
3822     "base": "http://other.com/",
3823     "failure": true
3824   },
3825   "Misc Unicode",
3826   {
3827     "input": "http://foo:💩@example.com/bar",
3828     "base": "http://other.com/",
3829     "href": "http://foo:%F0%9F%92%A9@example.com/bar",
3830     "origin": "http://example.com",
3831     "protocol": "http:",
3832     "username": "foo",
3833     "password": "%F0%9F%92%A9",
3834     "host": "example.com",
3835     "hostname": "example.com",
3836     "port": "",
3837     "pathname": "/bar",
3838     "search": "",
3839     "hash": ""
3840   },
3841   "# resolving a fragment against any scheme succeeds",
3842   {
3843     "input": "#",
3844     "base": "test:test",
3845     "href": "test:test#",
3846     "origin": "null",
3847     "protocol": "test:",
3848     "username": "",
3849     "password": "",
3850     "host": "",
3851     "hostname": "",
3852     "port": "",
3853     "pathname": "test",
3854     "search": "",
3855     "hash": ""
3856   },
3857   {
3858     "input": "#x",
3859     "base": "mailto:x@x.com",
3860     "href": "mailto:x@x.com#x",
3861     "origin": "null",
3862     "protocol": "mailto:",
3863     "username": "",
3864     "password": "",
3865     "host": "",
3866     "hostname": "",
3867     "port": "",
3868     "pathname": "x@x.com",
3869     "search": "",
3870     "hash": "#x"
3871   },
3872   {
3873     "input": "#x",
3874     "base": "data:,",
3875     "href": "data:,#x",
3876     "origin": "null",
3877     "protocol": "data:",
3878     "username": "",
3879     "password": "",
3880     "host": "",
3881     "hostname": "",
3882     "port": "",
3883     "pathname": ",",
3884     "search": "",
3885     "hash": "#x"
3886   },
3887   {
3888     "input": "#x",
3889     "base": "about:blank",
3890     "href": "about:blank#x",
3891     "origin": "null",
3892     "protocol": "about:",
3893     "username": "",
3894     "password": "",
3895     "host": "",
3896     "hostname": "",
3897     "port": "",
3898     "pathname": "blank",
3899     "search": "",
3900     "hash": "#x"
3901   },
3902   {
3903     "input": "#x:y",
3904     "base": "about:blank",
3905     "href": "about:blank#x:y",
3906     "origin": "null",
3907     "protocol": "about:",
3908     "username": "",
3909     "password": "",
3910     "host": "",
3911     "hostname": "",
3912     "port": "",
3913     "pathname": "blank",
3914     "search": "",
3915     "hash": "#x:y"
3916   },
3917   {
3918     "input": "#",
3919     "base": "test:test?test",
3920     "href": "test:test?test#",
3921     "origin": "null",
3922     "protocol": "test:",
3923     "username": "",
3924     "password": "",
3925     "host": "",
3926     "hostname": "",
3927     "port": "",
3928     "pathname": "test",
3929     "search": "?test",
3930     "hash": ""
3931   },
3932   "# multiple @ in authority state",
3933   {
3934     "input": "https://@test@test@example:800/",
3935     "base": "http://doesnotmatter/",
3936     "href": "https://%40test%40test@example:800/",
3937     "origin": "https://example:800",
3938     "protocol": "https:",
3939     "username": "%40test%40test",
3940     "password": "",
3941     "host": "example:800",
3942     "hostname": "example",
3943     "port": "800",
3944     "pathname": "/",
3945     "search": "",
3946     "hash": ""
3947   },
3948   {
3949     "input": "https://@@@example",
3950     "base": "http://doesnotmatter/",
3951     "href": "https://%40%40@example/",
3952     "origin": "https://example",
3953     "protocol": "https:",
3954     "username": "%40%40",
3955     "password": "",
3956     "host": "example",
3957     "hostname": "example",
3958     "port": "",
3959     "pathname": "/",
3960     "search": "",
3961     "hash": ""
3962   },
3963   "non-az-09 characters",
3964   {
3965     "input": "http://`{}:`{}@h/`{}?`{}",
3966     "base": "http://doesnotmatter/",
3967     "href": "http://%60%7B%7D:%60%7B%7D@h/%60%7B%7D?`{}",
3968     "origin": "http://h",
3969     "protocol": "http:",
3970     "username": "%60%7B%7D",
3971     "password": "%60%7B%7D",
3972     "host": "h",
3973     "hostname": "h",
3974     "port": "",
3975     "pathname": "/%60%7B%7D",
3976     "search": "?`{}",
3977     "hash": ""
3978   },
3979   "byte is ' and url is special",
3980   {
3981     "input": "http://host/?'",
3982     "base": null,
3983     "href": "http://host/?%27",
3984     "origin": "http://host",
3985     "protocol": "http:",
3986     "username": "",
3987     "password": "",
3988     "host": "host",
3989     "hostname": "host",
3990     "port": "",
3991     "pathname": "/",
3992     "search": "?%27",
3993     "hash": ""
3994   },
3995   {
3996     "input": "notspecial://host/?'",
3997     "base": null,
3998     "href": "notspecial://host/?'",
3999     "origin": "null",
4000     "protocol": "notspecial:",
4001     "username": "",
4002     "password": "",
4003     "host": "host",
4004     "hostname": "host",
4005     "port": "",
4006     "pathname": "/",
4007     "search": "?'",
4008     "hash": ""
4009   },
4010   "# Credentials in base",
4011   {
4012     "input": "/some/path",
4013     "base": "http://user@example.org/smth",
4014     "href": "http://user@example.org/some/path",
4015     "origin": "http://example.org",
4016     "protocol": "http:",
4017     "username": "user",
4018     "password": "",
4019     "host": "example.org",
4020     "hostname": "example.org",
4021     "port": "",
4022     "pathname": "/some/path",
4023     "search": "",
4024     "hash": ""
4025   },
4026   {
4027     "input": "",
4028     "base": "http://user:pass@example.org:21/smth",
4029     "href": "http://user:pass@example.org:21/smth",
4030     "origin": "http://example.org:21",
4031     "protocol": "http:",
4032     "username": "user",
4033     "password": "pass",
4034     "host": "example.org:21",
4035     "hostname": "example.org",
4036     "port": "21",
4037     "pathname": "/smth",
4038     "search": "",
4039     "hash": ""
4040   },
4041   {
4042     "input": "/some/path",
4043     "base": "http://user:pass@example.org:21/smth",
4044     "href": "http://user:pass@example.org:21/some/path",
4045     "origin": "http://example.org:21",
4046     "protocol": "http:",
4047     "username": "user",
4048     "password": "pass",
4049     "host": "example.org:21",
4050     "hostname": "example.org",
4051     "port": "21",
4052     "pathname": "/some/path",
4053     "search": "",
4054     "hash": ""
4055   },
4056   "# a set of tests designed by zcorpan for relative URLs with unknown schemes",
4057   {
4058     "input": "i",
4059     "base": "sc:sd",
4060     "failure": true
4061   },
4062   {
4063     "input": "i",
4064     "base": "sc:sd/sd",
4065     "failure": true
4066   },
4067   {
4068     "input": "i",
4069     "base": "sc:/pa/pa",
4070     "href": "sc:/pa/i",
4071     "origin": "null",
4072     "protocol": "sc:",
4073     "username": "",
4074     "password": "",
4075     "host": "",
4076     "hostname": "",
4077     "port": "",
4078     "pathname": "/pa/i",
4079     "search": "",
4080     "hash": ""
4081   },
4082   {
4083     "input": "i",
4084     "base": "sc://ho/pa",
4085     "href": "sc://ho/i",
4086     "origin": "null",
4087     "protocol": "sc:",
4088     "username": "",
4089     "password": "",
4090     "host": "ho",
4091     "hostname": "ho",
4092     "port": "",
4093     "pathname": "/i",
4094     "search": "",
4095     "hash": ""
4096   },
4097   {
4098     "input": "i",
4099     "base": "sc:///pa/pa",
4100     "href": "sc:///pa/i",
4101     "origin": "null",
4102     "protocol": "sc:",
4103     "username": "",
4104     "password": "",
4105     "host": "",
4106     "hostname": "",
4107     "port": "",
4108     "pathname": "/pa/i",
4109     "search": "",
4110     "hash": ""
4111   },
4112   {
4113     "input": "../i",
4114     "base": "sc:sd",
4115     "failure": true
4116   },
4117   {
4118     "input": "../i",
4119     "base": "sc:sd/sd",
4120     "failure": true
4121   },
4122   {
4123     "input": "../i",
4124     "base": "sc:/pa/pa",
4125     "href": "sc:/i",
4126     "origin": "null",
4127     "protocol": "sc:",
4128     "username": "",
4129     "password": "",
4130     "host": "",
4131     "hostname": "",
4132     "port": "",
4133     "pathname": "/i",
4134     "search": "",
4135     "hash": ""
4136   },
4137   {
4138     "input": "../i",
4139     "base": "sc://ho/pa",
4140     "href": "sc://ho/i",
4141     "origin": "null",
4142     "protocol": "sc:",
4143     "username": "",
4144     "password": "",
4145     "host": "ho",
4146     "hostname": "ho",
4147     "port": "",
4148     "pathname": "/i",
4149     "search": "",
4150     "hash": ""
4151   },
4152   {
4153     "input": "../i",
4154     "base": "sc:///pa/pa",
4155     "href": "sc:///i",
4156     "origin": "null",
4157     "protocol": "sc:",
4158     "username": "",
4159     "password": "",
4160     "host": "",
4161     "hostname": "",
4162     "port": "",
4163     "pathname": "/i",
4164     "search": "",
4165     "hash": ""
4166   },
4167   {
4168     "input": "/i",
4169     "base": "sc:sd",
4170     "failure": true
4171   },
4172   {
4173     "input": "/i",
4174     "base": "sc:sd/sd",
4175     "failure": true
4176   },
4177   {
4178     "input": "/i",
4179     "base": "sc:/pa/pa",
4180     "href": "sc:/i",
4181     "origin": "null",
4182     "protocol": "sc:",
4183     "username": "",
4184     "password": "",
4185     "host": "",
4186     "hostname": "",
4187     "port": "",
4188     "pathname": "/i",
4189     "search": "",
4190     "hash": ""
4191   },
4192   {
4193     "input": "/i",
4194     "base": "sc://ho/pa",
4195     "href": "sc://ho/i",
4196     "origin": "null",
4197     "protocol": "sc:",
4198     "username": "",
4199     "password": "",
4200     "host": "ho",
4201     "hostname": "ho",
4202     "port": "",
4203     "pathname": "/i",
4204     "search": "",
4205     "hash": ""
4206   },
4207   {
4208     "input": "/i",
4209     "base": "sc:///pa/pa",
4210     "href": "sc:///i",
4211     "origin": "null",
4212     "protocol": "sc:",
4213     "username": "",
4214     "password": "",
4215     "host": "",
4216     "hostname": "",
4217     "port": "",
4218     "pathname": "/i",
4219     "search": "",
4220     "hash": ""
4221   },
4222   {
4223     "input": "?i",
4224     "base": "sc:sd",
4225     "failure": true
4226   },
4227   {
4228     "input": "?i",
4229     "base": "sc:sd/sd",
4230     "failure": true
4231   },
4232   {
4233     "input": "?i",
4234     "base": "sc:/pa/pa",
4235     "href": "sc:/pa/pa?i",
4236     "origin": "null",
4237     "protocol": "sc:",
4238     "username": "",
4239     "password": "",
4240     "host": "",
4241     "hostname": "",
4242     "port": "",
4243     "pathname": "/pa/pa",
4244     "search": "?i",
4245     "hash": ""
4246   },
4247   {
4248     "input": "?i",
4249     "base": "sc://ho/pa",
4250     "href": "sc://ho/pa?i",
4251     "origin": "null",
4252     "protocol": "sc:",
4253     "username": "",
4254     "password": "",
4255     "host": "ho",
4256     "hostname": "ho",
4257     "port": "",
4258     "pathname": "/pa",
4259     "search": "?i",
4260     "hash": ""
4261   },
4262   {
4263     "input": "?i",
4264     "base": "sc:///pa/pa",
4265     "href": "sc:///pa/pa?i",
4266     "origin": "null",
4267     "protocol": "sc:",
4268     "username": "",
4269     "password": "",
4270     "host": "",
4271     "hostname": "",
4272     "port": "",
4273     "pathname": "/pa/pa",
4274     "search": "?i",
4275     "hash": ""
4276   },
4277   {
4278     "input": "#i",
4279     "base": "sc:sd",
4280     "href": "sc:sd#i",
4281     "origin": "null",
4282     "protocol": "sc:",
4283     "username": "",
4284     "password": "",
4285     "host": "",
4286     "hostname": "",
4287     "port": "",
4288     "pathname": "sd",
4289     "search": "",
4290     "hash": "#i"
4291   },
4292   {
4293     "input": "#i",
4294     "base": "sc:sd/sd",
4295     "href": "sc:sd/sd#i",
4296     "origin": "null",
4297     "protocol": "sc:",
4298     "username": "",
4299     "password": "",
4300     "host": "",
4301     "hostname": "",
4302     "port": "",
4303     "pathname": "sd/sd",
4304     "search": "",
4305     "hash": "#i"
4306   },
4307   {
4308     "input": "#i",
4309     "base": "sc:/pa/pa",
4310     "href": "sc:/pa/pa#i",
4311     "origin": "null",
4312     "protocol": "sc:",
4313     "username": "",
4314     "password": "",
4315     "host": "",
4316     "hostname": "",
4317     "port": "",
4318     "pathname": "/pa/pa",
4319     "search": "",
4320     "hash": "#i"
4321   },
4322   {
4323     "input": "#i",
4324     "base": "sc://ho/pa",
4325     "href": "sc://ho/pa#i",
4326     "origin": "null",
4327     "protocol": "sc:",
4328     "username": "",
4329     "password": "",
4330     "host": "ho",
4331     "hostname": "ho",
4332     "port": "",
4333     "pathname": "/pa",
4334     "search": "",
4335     "hash": "#i"
4336   },
4337   {
4338     "input": "#i",
4339     "base": "sc:///pa/pa",
4340     "href": "sc:///pa/pa#i",
4341     "origin": "null",
4342     "protocol": "sc:",
4343     "username": "",
4344     "password": "",
4345     "host": "",
4346     "hostname": "",
4347     "port": "",
4348     "pathname": "/pa/pa",
4349     "search": "",
4350     "hash": "#i"
4351   },
4352   "# make sure that relative URL logic works on known typically non-relative schemes too",
4353   {
4354     "input": "data:/../",
4355     "base": null,
4356     "href": "data:/",
4357     "origin": "null",
4358     "protocol": "data:",
4359     "username": "",
4360     "password": "",
4361     "host": "",
4362     "hostname": "",
4363     "port": "",
4364     "pathname": "/",
4365     "search": "",
4366     "hash": ""
4367   },
4368   {
4369     "input": "javascript:/../",
4370     "base": null,
4371     "href": "javascript:/",
4372     "origin": "null",
4373     "protocol": "javascript:",
4374     "username": "",
4375     "password": "",
4376     "host": "",
4377     "hostname": "",
4378     "port": "",
4379     "pathname": "/",
4380     "search": "",
4381     "hash": ""
4382   },
4383   {
4384     "input": "mailto:/../",
4385     "base": null,
4386     "href": "mailto:/",
4387     "origin": "null",
4388     "protocol": "mailto:",
4389     "username": "",
4390     "password": "",
4391     "host": "",
4392     "hostname": "",
4393     "port": "",
4394     "pathname": "/",
4395     "search": "",
4396     "hash": ""
4397   },
4398   "# unknown schemes and their hosts",
4399   {
4400     "input": "sc://ñ.test/",
4401     "base": null,
4402     "href": "sc://%C3%B1.test/",
4403     "origin": "null",
4404     "protocol": "sc:",
4405     "username": "",
4406     "password": "",
4407     "host": "%C3%B1.test",
4408     "hostname": "%C3%B1.test",
4409     "port": "",
4410     "pathname": "/",
4411     "search": "",
4412     "hash": ""
4413   },
4414   {
4415     "input": "sc://%/",
4416     "base": null,
4417     "href": "sc://%/",
4418     "protocol": "sc:",
4419     "username": "",
4420     "password": "",
4421     "host": "%",
4422     "hostname": "%",
4423     "port": "",
4424     "pathname": "/",
4425     "search": "",
4426     "hash": ""
4427   },
4428   {
4429     "input": "sc://@/",
4430     "base": null,
4431     "failure": true
4432   },
4433   {
4434     "input": "sc://te@s:t@/",
4435     "base": null,
4436     "failure": true
4437   },
4438   {
4439     "input": "sc://:/",
4440     "base": null,
4441     "failure": true
4442   },
4443   {
4444     "input": "sc://:12/",
4445     "base": null,
4446     "failure": true
4447   },
4448   {
4449     "input": "x",
4450     "base": "sc://ñ",
4451     "href": "sc://%C3%B1/x",
4452     "origin": "null",
4453     "protocol": "sc:",
4454     "username": "",
4455     "password": "",
4456     "host": "%C3%B1",
4457     "hostname": "%C3%B1",
4458     "port": "",
4459     "pathname": "/x",
4460     "search": "",
4461     "hash": ""
4462   },
4463   "# unknown schemes and backslashes",
4464   {
4465     "input": "sc:\\../",
4466     "base": null,
4467     "href": "sc:\\../",
4468     "origin": "null",
4469     "protocol": "sc:",
4470     "username": "",
4471     "password": "",
4472     "host": "",
4473     "hostname": "",
4474     "port": "",
4475     "pathname": "\\../",
4476     "search": "",
4477     "hash": ""
4478   },
4479   "# unknown scheme with path looking like a password",
4480   {
4481     "input": "sc::a@example.net",
4482     "base": null,
4483     "href": "sc::a@example.net",
4484     "origin": "null",
4485     "protocol": "sc:",
4486     "username": "",
4487     "password": "",
4488     "host": "",
4489     "hostname": "",
4490     "port": "",
4491     "pathname": ":a@example.net",
4492     "search": "",
4493     "hash": ""
4494   },
4495   "# unknown scheme with bogus percent-encoding",
4496   {
4497     "input": "wow:%NBD",
4498     "base": null,
4499     "href": "wow:%NBD",
4500     "origin": "null",
4501     "protocol": "wow:",
4502     "username": "",
4503     "password": "",
4504     "host": "",
4505     "hostname": "",
4506     "port": "",
4507     "pathname": "%NBD",
4508     "search": "",
4509     "hash": ""
4510   },
4511   {
4512     "input": "wow:%1G",
4513     "base": null,
4514     "href": "wow:%1G",
4515     "origin": "null",
4516     "protocol": "wow:",
4517     "username": "",
4518     "password": "",
4519     "host": "",
4520     "hostname": "",
4521     "port": "",
4522     "pathname": "%1G",
4523     "search": "",
4524     "hash": ""
4525   },
4526   "# unknown scheme with non-URL characters",
4527   {
4528     "input": "wow:\uFFFF",
4529     "base": null,
4530     "href": "wow:%EF%BF%BF",
4531     "origin": "null",
4532     "protocol": "wow:",
4533     "username": "",
4534     "password": "",
4535     "host": "",
4536     "hostname": "",
4537     "port": "",
4538     "pathname": "%EF%BF%BF",
4539     "search": "",
4540     "hash": ""
4541   },
4542   "Forbidden host code points",
4543   {
4544     "input": "sc://a\u0000b/",
4545     "base": null,
4546     "failure": true
4547   },
4548   {
4549     "input": "sc://a b/",
4550     "base": null,
4551     "failure": true
4552   },
4553   {
4554     "input": "sc://a<b",
4555     "base": null,
4556     "failure": true
4557   },
4558   {
4559     "input": "sc://a>b",
4560     "base": null,
4561     "failure": true
4562   },
4563   {
4564     "input": "sc://a[b/",
4565     "base": null,
4566     "failure": true
4567   },
4568   {
4569     "input": "sc://a\\b/",
4570     "base": null,
4571     "failure": true
4572   },
4573   {
4574     "input": "sc://a]b/",
4575     "base": null,
4576     "failure": true
4577   },
4578   {
4579     "input": "sc://a^b",
4580     "base": null,
4581     "failure": true
4582   },
4583   {
4584     "input": "sc://a|b/",
4585     "base": null,
4586     "failure": true
4587   },
4588   "Forbidden host codepoints: tabs and newlines are removed during preprocessing",
4589   {
4590     "input": "foo://ho\u0009st/",
4591     "base": null,
4592     "hash": "",
4593     "host": "host",
4594     "hostname": "host",
4595     "href": "foo://host/",
4596     "password": "",
4597     "pathname": "/",
4598     "port": "",
4599     "protocol": "foo:",
4600     "search": "",
4601     "username": ""
4602   },
4603   {
4604     "input": "foo://ho\u000Ast/",
4605     "base": null,
4606     "hash": "",
4607     "host": "host",
4608     "hostname": "host",
4609     "href": "foo://host/",
4610     "password": "",
4611     "pathname": "/",
4612     "port": "",
4613     "protocol": "foo:",
4614     "search": "",
4615     "username": ""
4616   },
4617   {
4618     "input": "foo://ho\u000Dst/",
4619     "base": null,
4620     "hash": "",
4621     "host": "host",
4622     "hostname": "host",
4623     "href": "foo://host/",
4624     "password": "",
4625     "pathname": "/",
4626     "port": "",
4627     "protocol": "foo:",
4628     "search": "",
4629     "username": ""
4630   },
4631   "Forbidden domain code-points",
4632   {
4633     "input": "http://a\u0000b/",
4634     "base": null,
4635     "failure": true
4636   },
4637   {
4638     "input": "http://a\u0001b/",
4639     "base": null,
4640     "failure": true
4641   },
4642   {
4643     "input": "http://a\u0002b/",
4644     "base": null,
4645     "failure": true
4646   },
4647   {
4648     "input": "http://a\u0003b/",
4649     "base": null,
4650     "failure": true
4651   },
4652   {
4653     "input": "http://a\u0004b/",
4654     "base": null,
4655     "failure": true
4656   },
4657   {
4658     "input": "http://a\u0005b/",
4659     "base": null,
4660     "failure": true
4661   },
4662   {
4663     "input": "http://a\u0006b/",
4664     "base": null,
4665     "failure": true
4666   },
4667   {
4668     "input": "http://a\u0007b/",
4669     "base": null,
4670     "failure": true
4671   },
4672   {
4673     "input": "http://a\u0008b/",
4674     "base": null,
4675     "failure": true
4676   },
4677   {
4678     "input": "http://a\u000Bb/",
4679     "base": null,
4680     "failure": true
4681   },
4682   {
4683     "input": "http://a\u000Cb/",
4684     "base": null,
4685     "failure": true
4686   },
4687   {
4688     "input": "http://a\u000Eb/",
4689     "base": null,
4690     "failure": true
4691   },
4692   {
4693     "input": "http://a\u000Fb/",
4694     "base": null,
4695     "failure": true
4696   },
4697   {
4698     "input": "http://a\u0010b/",
4699     "base": null,
4700     "failure": true
4701   },
4702   {
4703     "input": "http://a\u0011b/",
4704     "base": null,
4705     "failure": true
4706   },
4707   {
4708     "input": "http://a\u0012b/",
4709     "base": null,
4710     "failure": true
4711   },
4712   {
4713     "input": "http://a\u0013b/",
4714     "base": null,
4715     "failure": true
4716   },
4717   {
4718     "input": "http://a\u0014b/",
4719     "base": null,
4720     "failure": true
4721   },
4722   {
4723     "input": "http://a\u0015b/",
4724     "base": null,
4725     "failure": true
4726   },
4727   {
4728     "input": "http://a\u0016b/",
4729     "base": null,
4730     "failure": true
4731   },
4732   {
4733     "input": "http://a\u0017b/",
4734     "base": null,
4735     "failure": true
4736   },
4737   {
4738     "input": "http://a\u0018b/",
4739     "base": null,
4740     "failure": true
4741   },
4742   {
4743     "input": "http://a\u0019b/",
4744     "base": null,
4745     "failure": true
4746   },
4747   {
4748     "input": "http://a\u001Ab/",
4749     "base": null,
4750     "failure": true
4751   },
4752   {
4753     "input": "http://a\u001Bb/",
4754     "base": null,
4755     "failure": true
4756   },
4757   {
4758     "input": "http://a\u001Cb/",
4759     "base": null,
4760     "failure": true
4761   },
4762   {
4763     "input": "http://a\u001Db/",
4764     "base": null,
4765     "failure": true
4766   },
4767   {
4768     "input": "http://a\u001Eb/",
4769     "base": null,
4770     "failure": true
4771   },
4772   {
4773     "input": "http://a\u001Fb/",
4774     "base": null,
4775     "failure": true
4776   },
4777   {
4778     "input": "http://a b/",
4779     "base": null,
4780     "failure": true
4781   },
4782   {
4783     "input": "http://a%b/",
4784     "base": null,
4785     "failure": true
4786   },
4787   {
4788     "input": "http://a<b",
4789     "base": null,
4790     "failure": true
4791   },
4792   {
4793     "input": "http://a>b",
4794     "base": null,
4795     "failure": true
4796   },
4797   {
4798     "input": "http://a[b/",
4799     "base": null,
4800     "failure": true
4801   },
4802   {
4803     "input": "http://a]b/",
4804     "base": null,
4805     "failure": true
4806   },
4807   {
4808     "input": "http://a^b",
4809     "base": null,
4810     "failure": true
4811   },
4812   {
4813     "input": "http://a|b/",
4814     "base": null,
4815     "failure": true
4816   },
4817   {
4818     "input": "http://a\u007Fb/",
4819     "base": null,
4820     "failure": true
4821   },
4822   "Forbidden domain codepoints: tabs and newlines are removed during preprocessing",
4823   {
4824     "input": "http://ho\u0009st/",
4825     "base": null,
4826     "hash": "",
4827     "host": "host",
4828     "hostname": "host",
4829     "href": "http://host/",
4830     "password": "",
4831     "pathname": "/",
4832     "port": "",
4833     "protocol": "http:",
4834     "search": "",
4835     "username": ""
4836   },
4837   {
4838     "input": "http://ho\u000Ast/",
4839     "base": null,
4840     "hash": "",
4841     "host": "host",
4842     "hostname": "host",
4843     "href": "http://host/",
4844     "password": "",
4845     "pathname": "/",
4846     "port": "",
4847     "protocol": "http:",
4848     "search": "",
4849     "username": ""
4850   },
4851   {
4852     "input": "http://ho\u000Dst/",
4853     "base": null,
4854     "hash": "",
4855     "host": "host",
4856     "hostname": "host",
4857     "href": "http://host/",
4858     "password": "",
4859     "pathname": "/",
4860     "port": "",
4861     "protocol": "http:",
4862     "search": "",
4863     "username": ""
4864   },
4865   "Encoded forbidden domain codepoints in special URLs",
4866   {
4867     "input": "http://ho%00st/",
4868     "base": null,
4869     "failure": true
4870   },
4871   {
4872     "input": "http://ho%01st/",
4873     "base": null,
4874     "failure": true
4875   },
4876   {
4877     "input": "http://ho%02st/",
4878     "base": null,
4879     "failure": true
4880   },
4881   {
4882     "input": "http://ho%03st/",
4883     "base": null,
4884     "failure": true
4885   },
4886   {
4887     "input": "http://ho%04st/",
4888     "base": null,
4889     "failure": true
4890   },
4891   {
4892     "input": "http://ho%05st/",
4893     "base": null,
4894     "failure": true
4895   },
4896   {
4897     "input": "http://ho%06st/",
4898     "base": null,
4899     "failure": true
4900   },
4901   {
4902     "input": "http://ho%07st/",
4903     "base": null,
4904     "failure": true
4905   },
4906   {
4907     "input": "http://ho%08st/",
4908     "base": null,
4909     "failure": true
4910   },
4911   {
4912     "input": "http://ho%09st/",
4913     "base": null,
4914     "failure": true
4915   },
4916   {
4917     "input": "http://ho%0Ast/",
4918     "base": null,
4919     "failure": true
4920   },
4921   {
4922     "input": "http://ho%0Bst/",
4923     "base": null,
4924     "failure": true
4925   },
4926   {
4927     "input": "http://ho%0Cst/",
4928     "base": null,
4929     "failure": true
4930   },
4931   {
4932     "input": "http://ho%0Dst/",
4933     "base": null,
4934     "failure": true
4935   },
4936   {
4937     "input": "http://ho%0Est/",
4938     "base": null,
4939     "failure": true
4940   },
4941   {
4942     "input": "http://ho%0Fst/",
4943     "base": null,
4944     "failure": true
4945   },
4946   {
4947     "input": "http://ho%10st/",
4948     "base": null,
4949     "failure": true
4950   },
4951   {
4952     "input": "http://ho%11st/",
4953     "base": null,
4954     "failure": true
4955   },
4956   {
4957     "input": "http://ho%12st/",
4958     "base": null,
4959     "failure": true
4960   },
4961   {
4962     "input": "http://ho%13st/",
4963     "base": null,
4964     "failure": true
4965   },
4966   {
4967     "input": "http://ho%14st/",
4968     "base": null,
4969     "failure": true
4970   },
4971   {
4972     "input": "http://ho%15st/",
4973     "base": null,
4974     "failure": true
4975   },
4976   {
4977     "input": "http://ho%16st/",
4978     "base": null,
4979     "failure": true
4980   },
4981   {
4982     "input": "http://ho%17st/",
4983     "base": null,
4984     "failure": true
4985   },
4986   {
4987     "input": "http://ho%18st/",
4988     "base": null,
4989     "failure": true
4990   },
4991   {
4992     "input": "http://ho%19st/",
4993     "base": null,
4994     "failure": true
4995   },
4996   {
4997     "input": "http://ho%1Ast/",
4998     "base": null,
4999     "failure": true
5000   },
5001   {
5002     "input": "http://ho%1Bst/",
5003     "base": null,
5004     "failure": true
5005   },
5006   {
5007     "input": "http://ho%1Cst/",
5008     "base": null,
5009     "failure": true
5010   },
5011   {
5012     "input": "http://ho%1Dst/",
5013     "base": null,
5014     "failure": true
5015   },
5016   {
5017     "input": "http://ho%1Est/",
5018     "base": null,
5019     "failure": true
5020   },
5021   {
5022     "input": "http://ho%1Fst/",
5023     "base": null,
5024     "failure": true
5025   },
5026   {
5027     "input": "http://ho%20st/",
5028     "base": null,
5029     "failure": true
5030   },
5031   {
5032     "input": "http://ho%23st/",
5033     "base": null,
5034     "failure": true
5035   },
5036   {
5037     "input": "http://ho%25st/",
5038     "base": null,
5039     "failure": true
5040   },
5041   {
5042     "input": "http://ho%2Fst/",
5043     "base": null,
5044     "failure": true
5045   },
5046   {
5047     "input": "http://ho%3Ast/",
5048     "base": null,
5049     "failure": true
5050   },
5051   {
5052     "input": "http://ho%3Cst/",
5053     "base": null,
5054     "failure": true
5055   },
5056   {
5057     "input": "http://ho%3Est/",
5058     "base": null,
5059     "failure": true
5060   },
5061   {
5062     "input": "http://ho%3Fst/",
5063     "base": null,
5064     "failure": true
5065   },
5066   {
5067     "input": "http://ho%40st/",
5068     "base": null,
5069     "failure": true
5070   },
5071   {
5072     "input": "http://ho%5Bst/",
5073     "base": null,
5074     "failure": true
5075   },
5076   {
5077     "input": "http://ho%5Cst/",
5078     "base": null,
5079     "failure": true
5080   },
5081   {
5082     "input": "http://ho%5Dst/",
5083     "base": null,
5084     "failure": true
5085   },
5086   {
5087     "input": "http://ho%7Cst/",
5088     "base": null,
5089     "failure": true
5090   },
5091   {
5092     "input": "http://ho%7Fst/",
5093     "base": null,
5094     "failure": true
5095   },
5096   "Allowed host/domain code points",
5097   {
5098     "input": "sc://\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u000B\u000C\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F\u007F!\"$%&'()*+,-.;=_`{}~/",
5099     "base": null,
5100     "href": "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!\"$%&'()*+,-.;=_`{}~/",
5101     "origin": "null",
5102     "protocol": "sc:",
5103     "username": "",
5104     "password": "",
5105     "host": "%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!\"$%&'()*+,-.;=_`{}~",
5106     "hostname": "%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!\"$%&'()*+,-.;=_`{}~",
5107     "port": "",
5108     "pathname": "/",
5109     "search": "",
5110     "hash": ""
5111   },
5112   "# Hosts and percent-encoding",
5113   {
5114     "input": "ftp://example.com%80/",
5115     "base": null,
5116     "failure": true
5117   },
5118   {
5119     "input": "ftp://example.com%A0/",
5120     "base": null,
5121     "failure": true
5122   },
5123   {
5124     "input": "https://example.com%80/",
5125     "base": null,
5126     "failure": true
5127   },
5128   {
5129     "input": "https://example.com%A0/",
5130     "base": null,
5131     "failure": true
5132   },
5133   {
5134     "input": "ftp://%e2%98%83",
5135     "base": null,
5136     "href": "ftp://xn--n3h/",
5137     "origin": "ftp://xn--n3h",
5138     "protocol": "ftp:",
5139     "username": "",
5140     "password": "",
5141     "host": "xn--n3h",
5142     "hostname": "xn--n3h",
5143     "port": "",
5144     "pathname": "/",
5145     "search": "",
5146     "hash": ""
5147   },
5148   {
5149     "input": "https://%e2%98%83",
5150     "base": null,
5151     "href": "https://xn--n3h/",
5152     "origin": "https://xn--n3h",
5153     "protocol": "https:",
5154     "username": "",
5155     "password": "",
5156     "host": "xn--n3h",
5157     "hostname": "xn--n3h",
5158     "port": "",
5159     "pathname": "/",
5160     "search": "",
5161     "hash": ""
5162   },
5163   "# tests from jsdom/whatwg-url designed for code coverage",
5164   {
5165     "input": "http://127.0.0.1:10100/relative_import.html",
5166     "base": null,
5167     "href": "http://127.0.0.1:10100/relative_import.html",
5168     "origin": "http://127.0.0.1:10100",
5169     "protocol": "http:",
5170     "username": "",
5171     "password": "",
5172     "host": "127.0.0.1:10100",
5173     "hostname": "127.0.0.1",
5174     "port": "10100",
5175     "pathname": "/relative_import.html",
5176     "search": "",
5177     "hash": ""
5178   },
5179   {
5180     "input": "http://facebook.com/?foo=%7B%22abc%22",
5181     "base": null,
5182     "href": "http://facebook.com/?foo=%7B%22abc%22",
5183     "origin": "http://facebook.com",
5184     "protocol": "http:",
5185     "username": "",
5186     "password": "",
5187     "host": "facebook.com",
5188     "hostname": "facebook.com",
5189     "port": "",
5190     "pathname": "/",
5191     "search": "?foo=%7B%22abc%22",
5192     "hash": ""
5193   },
5194   {
5195     "input": "https://localhost:3000/jqueryui@1.2.3",
5196     "base": null,
5197     "href": "https://localhost:3000/jqueryui@1.2.3",
5198     "origin": "https://localhost:3000",
5199     "protocol": "https:",
5200     "username": "",
5201     "password": "",
5202     "host": "localhost:3000",
5203     "hostname": "localhost",
5204     "port": "3000",
5205     "pathname": "/jqueryui@1.2.3",
5206     "search": "",
5207     "hash": ""
5208   },
5209   "# tab/LF/CR",
5210   {
5211     "input": "h\tt\nt\rp://h\to\ns\rt:9\t0\n0\r0/p\ta\nt\rh?q\tu\ne\rry#f\tr\na\rg",
5212     "base": null,
5213     "href": "http://host:9000/path?query#frag",
5214     "origin": "http://host:9000",
5215     "protocol": "http:",
5216     "username": "",
5217     "password": "",
5218     "host": "host:9000",
5219     "hostname": "host",
5220     "port": "9000",
5221     "pathname": "/path",
5222     "search": "?query",
5223     "hash": "#frag"
5224   },
5225   "# Stringification of URL.searchParams",
5226   {
5227     "input": "?a=b&c=d",
5228     "base": "http://example.org/foo/bar",
5229     "href": "http://example.org/foo/bar?a=b&c=d",
5230     "origin": "http://example.org",
5231     "protocol": "http:",
5232     "username": "",
5233     "password": "",
5234     "host": "example.org",
5235     "hostname": "example.org",
5236     "port": "",
5237     "pathname": "/foo/bar",
5238     "search": "?a=b&c=d",
5239     "searchParams": "a=b&c=d",
5240     "hash": ""
5241   },
5242   {
5243     "input": "??a=b&c=d",
5244     "base": "http://example.org/foo/bar",
5245     "href": "http://example.org/foo/bar??a=b&c=d",
5246     "origin": "http://example.org",
5247     "protocol": "http:",
5248     "username": "",
5249     "password": "",
5250     "host": "example.org",
5251     "hostname": "example.org",
5252     "port": "",
5253     "pathname": "/foo/bar",
5254     "search": "??a=b&c=d",
5255     "searchParams": "%3Fa=b&c=d",
5256     "hash": ""
5257   },
5258   "# Scheme only",
5259   {
5260     "input": "http:",
5261     "base": "http://example.org/foo/bar",
5262     "href": "http://example.org/foo/bar",
5263     "origin": "http://example.org",
5264     "protocol": "http:",
5265     "username": "",
5266     "password": "",
5267     "host": "example.org",
5268     "hostname": "example.org",
5269     "port": "",
5270     "pathname": "/foo/bar",
5271     "search": "",
5272     "searchParams": "",
5273     "hash": ""
5274   },
5275   {
5276     "input": "http:",
5277     "base": "https://example.org/foo/bar",
5278     "failure": true
5279   },
5280   {
5281     "input": "sc:",
5282     "base": "https://example.org/foo/bar",
5283     "href": "sc:",
5284     "origin": "null",
5285     "protocol": "sc:",
5286     "username": "",
5287     "password": "",
5288     "host": "",
5289     "hostname": "",
5290     "port": "",
5291     "pathname": "",
5292     "search": "",
5293     "searchParams": "",
5294     "hash": ""
5295   },
5296   "# Percent encoding of fragments",
5297   {
5298     "input": "http://foo.bar/baz?qux#foo\bbar",
5299     "base": null,
5300     "href": "http://foo.bar/baz?qux#foo%08bar",
5301     "origin": "http://foo.bar",
5302     "protocol": "http:",
5303     "username": "",
5304     "password": "",
5305     "host": "foo.bar",
5306     "hostname": "foo.bar",
5307     "port": "",
5308     "pathname": "/baz",
5309     "search": "?qux",
5310     "searchParams": "qux=",
5311     "hash": "#foo%08bar"
5312   },
5313   {
5314     "input": "http://foo.bar/baz?qux#foo\"bar",
5315     "base": null,
5316     "href": "http://foo.bar/baz?qux#foo%22bar",
5317     "origin": "http://foo.bar",
5318     "protocol": "http:",
5319     "username": "",
5320     "password": "",
5321     "host": "foo.bar",
5322     "hostname": "foo.bar",
5323     "port": "",
5324     "pathname": "/baz",
5325     "search": "?qux",
5326     "searchParams": "qux=",
5327     "hash": "#foo%22bar"
5328   },
5329   {
5330     "input": "http://foo.bar/baz?qux#foo<bar",
5331     "base": null,
5332     "href": "http://foo.bar/baz?qux#foo%3Cbar",
5333     "origin": "http://foo.bar",
5334     "protocol": "http:",
5335     "username": "",
5336     "password": "",
5337     "host": "foo.bar",
5338     "hostname": "foo.bar",
5339     "port": "",
5340     "pathname": "/baz",
5341     "search": "?qux",
5342     "searchParams": "qux=",
5343     "hash": "#foo%3Cbar"
5344   },
5345   {
5346     "input": "http://foo.bar/baz?qux#foo>bar",
5347     "base": null,
5348     "href": "http://foo.bar/baz?qux#foo%3Ebar",
5349     "origin": "http://foo.bar",
5350     "protocol": "http:",
5351     "username": "",
5352     "password": "",
5353     "host": "foo.bar",
5354     "hostname": "foo.bar",
5355     "port": "",
5356     "pathname": "/baz",
5357     "search": "?qux",
5358     "searchParams": "qux=",
5359     "hash": "#foo%3Ebar"
5360   },
5361   {
5362     "input": "http://foo.bar/baz?qux#foo`bar",
5363     "base": null,
5364     "href": "http://foo.bar/baz?qux#foo%60bar",
5365     "origin": "http://foo.bar",
5366     "protocol": "http:",
5367     "username": "",
5368     "password": "",
5369     "host": "foo.bar",
5370     "hostname": "foo.bar",
5371     "port": "",
5372     "pathname": "/baz",
5373     "search": "?qux",
5374     "searchParams": "qux=",
5375     "hash": "#foo%60bar"
5376   },
5377   "# IPv4 parsing (via https://github.com/nodejs/node/pull/10317)",
5378   {
5379     "input": "http://1.2.3.4/",
5380     "base": "http://other.com/",
5381     "href": "http://1.2.3.4/",
5382     "origin": "http://1.2.3.4",
5383     "protocol": "http:",
5384     "username": "",
5385     "password": "",
5386     "host": "1.2.3.4",
5387     "hostname": "1.2.3.4",
5388     "port": "",
5389     "pathname": "/",
5390     "search": "",
5391     "hash": ""
5392   },
5393   {
5394     "input": "http://1.2.3.4./",
5395     "base": "http://other.com/",
5396     "href": "http://1.2.3.4/",
5397     "origin": "http://1.2.3.4",
5398     "protocol": "http:",
5399     "username": "",
5400     "password": "",
5401     "host": "1.2.3.4",
5402     "hostname": "1.2.3.4",
5403     "port": "",
5404     "pathname": "/",
5405     "search": "",
5406     "hash": ""
5407   },
5408   {
5409     "input": "http://192.168.257",
5410     "base": "http://other.com/",
5411     "href": "http://192.168.1.1/",
5412     "origin": "http://192.168.1.1",
5413     "protocol": "http:",
5414     "username": "",
5415     "password": "",
5416     "host": "192.168.1.1",
5417     "hostname": "192.168.1.1",
5418     "port": "",
5419     "pathname": "/",
5420     "search": "",
5421     "hash": ""
5422   },
5423   {
5424     "input": "http://192.168.257.",
5425     "base": "http://other.com/",
5426     "href": "http://192.168.1.1/",
5427     "origin": "http://192.168.1.1",
5428     "protocol": "http:",
5429     "username": "",
5430     "password": "",
5431     "host": "192.168.1.1",
5432     "hostname": "192.168.1.1",
5433     "port": "",
5434     "pathname": "/",
5435     "search": "",
5436     "hash": ""
5437   },
5438   {
5439     "input": "http://192.168.257.com",
5440     "base": "http://other.com/",
5441     "href": "http://192.168.257.com/",
5442     "origin": "http://192.168.257.com",
5443     "protocol": "http:",
5444     "username": "",
5445     "password": "",
5446     "host": "192.168.257.com",
5447     "hostname": "192.168.257.com",
5448     "port": "",
5449     "pathname": "/",
5450     "search": "",
5451     "hash": ""
5452   },
5453   {
5454     "input": "http://256",
5455     "base": "http://other.com/",
5456     "href": "http://0.0.1.0/",
5457     "origin": "http://0.0.1.0",
5458     "protocol": "http:",
5459     "username": "",
5460     "password": "",
5461     "host": "0.0.1.0",
5462     "hostname": "0.0.1.0",
5463     "port": "",
5464     "pathname": "/",
5465     "search": "",
5466     "hash": ""
5467   },
5468   {
5469     "input": "http://256.com",
5470     "base": "http://other.com/",
5471     "href": "http://256.com/",
5472     "origin": "http://256.com",
5473     "protocol": "http:",
5474     "username": "",
5475     "password": "",
5476     "host": "256.com",
5477     "hostname": "256.com",
5478     "port": "",
5479     "pathname": "/",
5480     "search": "",
5481     "hash": ""
5482   },
5483   {
5484     "input": "http://999999999",
5485     "base": "http://other.com/",
5486     "href": "http://59.154.201.255/",
5487     "origin": "http://59.154.201.255",
5488     "protocol": "http:",
5489     "username": "",
5490     "password": "",
5491     "host": "59.154.201.255",
5492     "hostname": "59.154.201.255",
5493     "port": "",
5494     "pathname": "/",
5495     "search": "",
5496     "hash": ""
5497   },
5498   {
5499     "input": "http://999999999.",
5500     "base": "http://other.com/",
5501     "href": "http://59.154.201.255/",
5502     "origin": "http://59.154.201.255",
5503     "protocol": "http:",
5504     "username": "",
5505     "password": "",
5506     "host": "59.154.201.255",
5507     "hostname": "59.154.201.255",
5508     "port": "",
5509     "pathname": "/",
5510     "search": "",
5511     "hash": "",
5512     "failure": true
5513   },
5514   {
5515     "input": "http://999999999.com",
5516     "base": "http://other.com/",
5517     "href": "http://999999999.com/",
5518     "origin": "http://999999999.com",
5519     "protocol": "http:",
5520     "username": "",
5521     "password": "",
5522     "host": "999999999.com",
5523     "hostname": "999999999.com",
5524     "port": "",
5525     "pathname": "/",
5526     "search": "",
5527     "hash": ""
5528   },
5529   {
5530     "input": "http://10000000000",
5531     "base": "http://other.com/",
5532     "failure": true
5533   },
5534   {
5535     "input": "http://10000000000.com",
5536     "base": "http://other.com/",
5537     "href": "http://10000000000.com/",
5538     "origin": "http://10000000000.com",
5539     "protocol": "http:",
5540     "username": "",
5541     "password": "",
5542     "host": "10000000000.com",
5543     "hostname": "10000000000.com",
5544     "port": "",
5545     "pathname": "/",
5546     "search": "",
5547     "hash": ""
5548   },
5549   {
5550     "input": "http://4294967295",
5551     "base": "http://other.com/",
5552     "href": "http://255.255.255.255/",
5553     "origin": "http://255.255.255.255",
5554     "protocol": "http:",
5555     "username": "",
5556     "password": "",
5557     "host": "255.255.255.255",
5558     "hostname": "255.255.255.255",
5559     "port": "",
5560     "pathname": "/",
5561     "search": "",
5562     "hash": ""
5563   },
5564   {
5565     "input": "http://4294967296",
5566     "base": "http://other.com/",
5567     "failure": true
5568   },
5569   {
5570     "input": "http://0xffffffff",
5571     "base": "http://other.com/",
5572     "href": "http://255.255.255.255/",
5573     "origin": "http://255.255.255.255",
5574     "protocol": "http:",
5575     "username": "",
5576     "password": "",
5577     "host": "255.255.255.255",
5578     "hostname": "255.255.255.255",
5579     "port": "",
5580     "pathname": "/",
5581     "search": "",
5582     "hash": ""
5583   },
5584   {
5585     "input": "http://0xffffffff1",
5586     "base": "http://other.com/",
5587     "failure": true
5588   },
5589   {
5590     "input": "http://256.256.256.256",
5591     "base": "http://other.com/",
5592     "failure": true
5593   },
5594   "More IPv4 parsing (via https://github.com/jsdom/whatwg-url/issues/92)",
5595   {
5596     "input": "https://0x100000000/test",
5597     "base": null,
5598     "failure": true
5599   },
5600   {
5601     "input": "https://256.0.0.1/test",
5602     "base": null,
5603     "failure": true
5604   },
5605   "# file URLs containing percent-encoded Windows drive letters (shouldn't work)",
5606   {
5607     "input": "file:///C%3A/",
5608     "base": null,
5609     "href": "file:///C%3A/",
5610     "protocol": "file:",
5611     "username": "",
5612     "password": "",
5613     "host": "",
5614     "hostname": "",
5615     "port": "",
5616     "pathname": "/C%3A/",
5617     "search": "",
5618     "hash": ""
5619   },
5620   {
5621     "input": "file:///C%7C/",
5622     "base": null,
5623     "href": "file:///C%7C/",
5624     "protocol": "file:",
5625     "username": "",
5626     "password": "",
5627     "host": "",
5628     "hostname": "",
5629     "port": "",
5630     "pathname": "/C%7C/",
5631     "search": "",
5632     "hash": ""
5633   },
5634   {
5635     "input": "file://%43%3A",
5636     "base": null,
5637     "failure": true
5638   },
5639   {
5640     "input": "file://%43%7C",
5641     "base": null,
5642     "failure": true
5643   },
5644   {
5645     "input": "file://%43|",
5646     "base": null,
5647     "failure": true
5648   },
5649   {
5650     "input": "file://C%7C",
5651     "base": null,
5652     "failure": true
5653   },
5654   {
5655     "input": "file://%43%7C/",
5656     "base": null,
5657     "failure": true
5658   },
5659   {
5660     "input": "https://%43%7C/",
5661     "base": null,
5662     "failure": true
5663   },
5664   {
5665     "input": "asdf://%43|/",
5666     "base": null,
5667     "failure": true
5668   },
5669   {
5670     "input": "asdf://%43%7C/",
5671     "base": null,
5672     "href": "asdf://%43%7C/",
5673     "origin": "null",
5674     "protocol": "asdf:",
5675     "username": "",
5676     "password": "",
5677     "host": "%43%7C",
5678     "hostname": "%43%7C",
5679     "port": "",
5680     "pathname": "/",
5681     "search": "",
5682     "hash": ""
5683   },
5684   "# file URLs relative to other file URLs (via https://github.com/jsdom/whatwg-url/pull/60)",
5685   {
5686     "input": "pix/submit.gif",
5687     "base": "file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html",
5688     "href": "file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif",
5689     "protocol": "file:",
5690     "username": "",
5691     "password": "",
5692     "host": "",
5693     "hostname": "",
5694     "port": "",
5695     "pathname": "/C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif",
5696     "search": "",
5697     "hash": ""
5698   },
5699   {
5700     "input": "..",
5701     "base": "file:///C:/",
5702     "href": "file:///C:/",
5703     "protocol": "file:",
5704     "username": "",
5705     "password": "",
5706     "host": "",
5707     "hostname": "",
5708     "port": "",
5709     "pathname": "/C:/",
5710     "search": "",
5711     "hash": ""
5712   },
5713   {
5714     "input": "..",
5715     "base": "file:///",
5716     "href": "file:///",
5717     "protocol": "file:",
5718     "username": "",
5719     "password": "",
5720     "host": "",
5721     "hostname": "",
5722     "port": "",
5723     "pathname": "/",
5724     "search": "",
5725     "hash": ""
5726   },
5727   "# More file URL tests by zcorpan and annevk",
5728   {
5729     "input": "/",
5730     "base": "file:///C:/a/b",
5731     "href": "file:///C:/",
5732     "protocol": "file:",
5733     "username": "",
5734     "password": "",
5735     "host": "",
5736     "hostname": "",
5737     "port": "",
5738     "pathname": "/C:/",
5739     "search": "",
5740     "hash": ""
5741   },
5742   {
5743     "input": "/",
5744     "base": "file://h/C:/a/b",
5745     "href": "file://h/C:/",
5746     "protocol": "file:",
5747     "username": "",
5748     "password": "",
5749     "host": "h",
5750     "hostname": "h",
5751     "port": "",
5752     "pathname": "/C:/",
5753     "search": "",
5754     "hash": ""
5755   },
5756   {
5757     "input": "/",
5758     "base": "file://h/a/b",
5759     "href": "file://h/",
5760     "protocol": "file:",
5761     "username": "",
5762     "password": "",
5763     "host": "h",
5764     "hostname": "h",
5765     "port": "",
5766     "pathname": "/",
5767     "search": "",
5768     "hash": ""
5769   },
5770   {
5771     "input": "//d:",
5772     "base": "file:///C:/a/b",
5773     "href": "file:///d:",
5774     "protocol": "file:",
5775     "username": "",
5776     "password": "",
5777     "host": "",
5778     "hostname": "",
5779     "port": "",
5780     "pathname": "/d:",
5781     "search": "",
5782     "hash": ""
5783   },
5784   {
5785     "input": "//d:/..",
5786     "base": "file:///C:/a/b",
5787     "href": "file:///d:/",
5788     "protocol": "file:",
5789     "username": "",
5790     "password": "",
5791     "host": "",
5792     "hostname": "",
5793     "port": "",
5794     "pathname": "/d:/",
5795     "search": "",
5796     "hash": ""
5797   },
5798   {
5799     "input": "..",
5800     "base": "file:///ab:/",
5801     "href": "file:///",
5802     "protocol": "file:",
5803     "username": "",
5804     "password": "",
5805     "host": "",
5806     "hostname": "",
5807     "port": "",
5808     "pathname": "/",
5809     "search": "",
5810     "hash": ""
5811   },
5812   {
5813     "input": "..",
5814     "base": "file:///1:/",
5815     "href": "file:///",
5816     "protocol": "file:",
5817     "username": "",
5818     "password": "",
5819     "host": "",
5820     "hostname": "",
5821     "port": "",
5822     "pathname": "/",
5823     "search": "",
5824     "hash": ""
5825   },
5826   {
5827     "input": "",
5828     "base": "file:///test?test#test",
5829     "href": "file:///test?test",
5830     "protocol": "file:",
5831     "username": "",
5832     "password": "",
5833     "host": "",
5834     "hostname": "",
5835     "port": "",
5836     "pathname": "/test",
5837     "search": "?test",
5838     "hash": ""
5839   },
5840   {
5841     "input": "file:",
5842     "base": "file:///test?test#test",
5843     "href": "file:///test?test",
5844     "protocol": "file:",
5845     "username": "",
5846     "password": "",
5847     "host": "",
5848     "hostname": "",
5849     "port": "",
5850     "pathname": "/test",
5851     "search": "?test",
5852     "hash": ""
5853   },
5854   {
5855     "input": "?x",
5856     "base": "file:///test?test#test",
5857     "href": "file:///test?x",
5858     "protocol": "file:",
5859     "username": "",
5860     "password": "",
5861     "host": "",
5862     "hostname": "",
5863     "port": "",
5864     "pathname": "/test",
5865     "search": "?x",
5866     "hash": ""
5867   },
5868   {
5869     "input": "file:?x",
5870     "base": "file:///test?test#test",
5871     "href": "file:///test?x",
5872     "protocol": "file:",
5873     "username": "",
5874     "password": "",
5875     "host": "",
5876     "hostname": "",
5877     "port": "",
5878     "pathname": "/test",
5879     "search": "?x",
5880     "hash": ""
5881   },
5882   {
5883     "input": "#x",
5884     "base": "file:///test?test#test",
5885     "href": "file:///test?test#x",
5886     "protocol": "file:",
5887     "username": "",
5888     "password": "",
5889     "host": "",
5890     "hostname": "",
5891     "port": "",
5892     "pathname": "/test",
5893     "search": "?test",
5894     "hash": "#x"
5895   },
5896   {
5897     "input": "file:#x",
5898     "base": "file:///test?test#test",
5899     "href": "file:///test?test#x",
5900     "protocol": "file:",
5901     "username": "",
5902     "password": "",
5903     "host": "",
5904     "hostname": "",
5905     "port": "",
5906     "pathname": "/test",
5907     "search": "?test",
5908     "hash": "#x"
5909   },
5910   "# File URLs and many (back)slashes",
5911   {
5912     "input": "file:\\\\//",
5913     "base": null,
5914     "href": "file:////",
5915     "protocol": "file:",
5916     "username": "",
5917     "password": "",
5918     "host": "",
5919     "hostname": "",
5920     "port": "",
5921     "pathname": "//",
5922     "search": "",
5923     "hash": ""
5924   },
5925   {
5926     "input": "file:\\\\\\\\",
5927     "base": null,
5928     "href": "file:////",
5929     "protocol": "file:",
5930     "username": "",
5931     "password": "",
5932     "host": "",
5933     "hostname": "",
5934     "port": "",
5935     "pathname": "//",
5936     "search": "",
5937     "hash": ""
5938   },
5939   {
5940     "input": "file:\\\\\\\\?fox",
5941     "base": null,
5942     "href": "file:////?fox",
5943     "protocol": "file:",
5944     "username": "",
5945     "password": "",
5946     "host": "",
5947     "hostname": "",
5948     "port": "",
5949     "pathname": "//",
5950     "search": "?fox",
5951     "hash": ""
5952   },
5953   {
5954     "input": "file:\\\\\\\\#guppy",
5955     "base": null,
5956     "href": "file:////#guppy",
5957     "protocol": "file:",
5958     "username": "",
5959     "password": "",
5960     "host": "",
5961     "hostname": "",
5962     "port": "",
5963     "pathname": "//",
5964     "search": "",
5965     "hash": "#guppy"
5966   },
5967   {
5968     "input": "file://spider///",
5969     "base": null,
5970     "href": "file://spider///",
5971     "protocol": "file:",
5972     "username": "",
5973     "password": "",
5974     "host": "spider",
5975     "hostname": "spider",
5976     "port": "",
5977     "pathname": "///",
5978     "search": "",
5979     "hash": ""
5980   },
5981   {
5982     "input": "file:\\\\localhost//",
5983     "base": null,
5984     "href": "file:////",
5985     "protocol": "file:",
5986     "username": "",
5987     "password": "",
5988     "host": "",
5989     "hostname": "",
5990     "port": "",
5991     "pathname": "//",
5992     "search": "",
5993     "hash": ""
5994   },
5995   {
5996     "input": "file:///localhost//cat",
5997     "base": null,
5998     "href": "file:///localhost//cat",
5999     "protocol": "file:",
6000     "username": "",
6001     "password": "",
6002     "host": "",
6003     "hostname": "",
6004     "port": "",
6005     "pathname": "/localhost//cat",
6006     "search": "",
6007     "hash": ""
6008   },
6009   {
6010     "input": "file://\\/localhost//cat",
6011     "base": null,
6012     "href": "file:////localhost//cat",
6013     "protocol": "file:",
6014     "username": "",
6015     "password": "",
6016     "host": "",
6017     "hostname": "",
6018     "port": "",
6019     "pathname": "//localhost//cat",
6020     "search": "",
6021     "hash": ""
6022   },
6023   {
6024     "input": "file://localhost//a//../..//",
6025     "base": null,
6026     "href": "file://///",
6027     "protocol": "file:",
6028     "username": "",
6029     "password": "",
6030     "host": "",
6031     "hostname": "",
6032     "port": "",
6033     "pathname": "///",
6034     "search": "",
6035     "hash": ""
6036   },
6037   {
6038     "input": "/////mouse",
6039     "base": "file:///elephant",
6040     "href": "file://///mouse",
6041     "protocol": "file:",
6042     "username": "",
6043     "password": "",
6044     "host": "",
6045     "hostname": "",
6046     "port": "",
6047     "pathname": "///mouse",
6048     "search": "",
6049     "hash": ""
6050   },
6051   {
6052     "input": "\\//pig",
6053     "base": "file://lion/",
6054     "href": "file:///pig",
6055     "protocol": "file:",
6056     "username": "",
6057     "password": "",
6058     "host": "",
6059     "hostname": "",
6060     "port": "",
6061     "pathname": "/pig",
6062     "search": "",
6063     "hash": ""
6064   },
6065   {
6066     "input": "\\/localhost//pig",
6067     "base": "file://lion/",
6068     "href": "file:////pig",
6069     "protocol": "file:",
6070     "username": "",
6071     "password": "",
6072     "host": "",
6073     "hostname": "",
6074     "port": "",
6075     "pathname": "//pig",
6076     "search": "",
6077     "hash": ""
6078   },
6079   {
6080     "input": "//localhost//pig",
6081     "base": "file://lion/",
6082     "href": "file:////pig",
6083     "protocol": "file:",
6084     "username": "",
6085     "password": "",
6086     "host": "",
6087     "hostname": "",
6088     "port": "",
6089     "pathname": "//pig",
6090     "search": "",
6091     "hash": ""
6092   },
6093   {
6094     "input": "/..//localhost//pig",
6095     "base": "file://lion/",
6096     "href": "file://lion//localhost//pig",
6097     "protocol": "file:",
6098     "username": "",
6099     "password": "",
6100     "host": "lion",
6101     "hostname": "lion",
6102     "port": "",
6103     "pathname": "//localhost//pig",
6104     "search": "",
6105     "hash": ""
6106   },
6107   {
6108     "input": "file://",
6109     "base": "file://ape/",
6110     "href": "file:///",
6111     "protocol": "file:",
6112     "username": "",
6113     "password": "",
6114     "host": "",
6115     "hostname": "",
6116     "port": "",
6117     "pathname": "/",
6118     "search": "",
6119     "hash": ""
6120   },
6121   "# File URLs with non-empty hosts",
6122   {
6123     "input": "/rooibos",
6124     "base": "file://tea/",
6125     "href": "file://tea/rooibos",
6126     "protocol": "file:",
6127     "username": "",
6128     "password": "",
6129     "host": "tea",
6130     "hostname": "tea",
6131     "port": "",
6132     "pathname": "/rooibos",
6133     "search": "",
6134     "hash": ""
6135   },
6136   {
6137     "input": "/?chai",
6138     "base": "file://tea/",
6139     "href": "file://tea/?chai",
6140     "protocol": "file:",
6141     "username": "",
6142     "password": "",
6143     "host": "tea",
6144     "hostname": "tea",
6145     "port": "",
6146     "pathname": "/",
6147     "search": "?chai",
6148     "hash": ""
6149   },
6150   "# Windows drive letter handling with the 'file:' base URL",
6151   {
6152     "input": "C|",
6153     "base": "file://host/dir/file",
6154     "href": "file://host/C:",
6155     "protocol": "file:",
6156     "username": "",
6157     "password": "",
6158     "host": "host",
6159     "hostname": "host",
6160     "port": "",
6161     "pathname": "/C:",
6162     "search": "",
6163     "hash": ""
6164   },
6165   {
6166     "input": "C|",
6167     "base": "file://host/D:/dir1/dir2/file",
6168     "href": "file://host/C:",
6169     "protocol": "file:",
6170     "username": "",
6171     "password": "",
6172     "host": "host",
6173     "hostname": "host",
6174     "port": "",
6175     "pathname": "/C:",
6176     "search": "",
6177     "hash": ""
6178   },
6179   {
6180     "input": "C|#",
6181     "base": "file://host/dir/file",
6182     "href": "file://host/C:#",
6183     "protocol": "file:",
6184     "username": "",
6185     "password": "",
6186     "host": "host",
6187     "hostname": "host",
6188     "port": "",
6189     "pathname": "/C:",
6190     "search": "",
6191     "hash": ""
6192   },
6193   {
6194     "input": "C|?",
6195     "base": "file://host/dir/file",
6196     "href": "file://host/C:?",
6197     "protocol": "file:",
6198     "username": "",
6199     "password": "",
6200     "host": "host",
6201     "hostname": "host",
6202     "port": "",
6203     "pathname": "/C:",
6204     "search": "",
6205     "hash": ""
6206   },
6207   {
6208     "input": "C|/",
6209     "base": "file://host/dir/file",
6210     "href": "file://host/C:/",
6211     "protocol": "file:",
6212     "username": "",
6213     "password": "",
6214     "host": "host",
6215     "hostname": "host",
6216     "port": "",
6217     "pathname": "/C:/",
6218     "search": "",
6219     "hash": ""
6220   },
6221   {
6222     "input": "C|\n/",
6223     "base": "file://host/dir/file",
6224     "href": "file://host/C:/",
6225     "protocol": "file:",
6226     "username": "",
6227     "password": "",
6228     "host": "host",
6229     "hostname": "host",
6230     "port": "",
6231     "pathname": "/C:/",
6232     "search": "",
6233     "hash": ""
6234   },
6235   {
6236     "input": "C|\\",
6237     "base": "file://host/dir/file",
6238     "href": "file://host/C:/",
6239     "protocol": "file:",
6240     "username": "",
6241     "password": "",
6242     "host": "host",
6243     "hostname": "host",
6244     "port": "",
6245     "pathname": "/C:/",
6246     "search": "",
6247     "hash": ""
6248   },
6249   {
6250     "input": "C",
6251     "base": "file://host/dir/file",
6252     "href": "file://host/dir/C",
6253     "protocol": "file:",
6254     "username": "",
6255     "password": "",
6256     "host": "host",
6257     "hostname": "host",
6258     "port": "",
6259     "pathname": "/dir/C",
6260     "search": "",
6261     "hash": ""
6262   },
6263   {
6264     "input": "C|a",
6265     "base": "file://host/dir/file",
6266     "href": "file://host/dir/C|a",
6267     "protocol": "file:",
6268     "username": "",
6269     "password": "",
6270     "host": "host",
6271     "hostname": "host",
6272     "port": "",
6273     "pathname": "/dir/C|a",
6274     "search": "",
6275     "hash": ""
6276   },
6277   "# Windows drive letter quirk in the file slash state",
6278   {
6279     "input": "/c:/foo/bar",
6280     "base": "file:///c:/baz/qux",
6281     "href": "file:///c:/foo/bar",
6282     "protocol": "file:",
6283     "username": "",
6284     "password": "",
6285     "host": "",
6286     "hostname": "",
6287     "port": "",
6288     "pathname": "/c:/foo/bar",
6289     "search": "",
6290     "hash": ""
6291   },
6292   {
6293     "input": "/c|/foo/bar",
6294     "base": "file:///c:/baz/qux",
6295     "href": "file:///c:/foo/bar",
6296     "protocol": "file:",
6297     "username": "",
6298     "password": "",
6299     "host": "",
6300     "hostname": "",
6301     "port": "",
6302     "pathname": "/c:/foo/bar",
6303     "search": "",
6304     "hash": ""
6305   },
6306   {
6307     "input": "file:\\c:\\foo\\bar",
6308     "base": "file:///c:/baz/qux",
6309     "href": "file:///c:/foo/bar",
6310     "protocol": "file:",
6311     "username": "",
6312     "password": "",
6313     "host": "",
6314     "hostname": "",
6315     "port": "",
6316     "pathname": "/c:/foo/bar",
6317     "search": "",
6318     "hash": ""
6319   },
6320   {
6321     "input": "/c:/foo/bar",
6322     "base": "file://host/path",
6323     "href": "file://host/c:/foo/bar",
6324     "protocol": "file:",
6325     "username": "",
6326     "password": "",
6327     "host": "host",
6328     "hostname": "host",
6329     "port": "",
6330     "pathname": "/c:/foo/bar",
6331     "search": "",
6332     "hash": ""
6333   },
6334   "# Do not drop the host in the presence of a drive letter",
6335   {
6336     "input": "file://example.net/C:/",
6337     "base": null,
6338     "href": "file://example.net/C:/",
6339     "protocol": "file:",
6340     "username": "",
6341     "password": "",
6342     "host": "example.net",
6343     "hostname": "example.net",
6344     "port": "",
6345     "pathname": "/C:/",
6346     "search": "",
6347     "hash": ""
6348   },
6349   {
6350     "input": "file://1.2.3.4/C:/",
6351     "base": null,
6352     "href": "file://1.2.3.4/C:/",
6353     "protocol": "file:",
6354     "username": "",
6355     "password": "",
6356     "host": "1.2.3.4",
6357     "hostname": "1.2.3.4",
6358     "port": "",
6359     "pathname": "/C:/",
6360     "search": "",
6361     "hash": ""
6362   },
6363   {
6364     "input": "file://[1::8]/C:/",
6365     "base": null,
6366     "href": "file://[1::8]/C:/",
6367     "protocol": "file:",
6368     "username": "",
6369     "password": "",
6370     "host": "[1::8]",
6371     "hostname": "[1::8]",
6372     "port": "",
6373     "pathname": "/C:/",
6374     "search": "",
6375     "hash": ""
6376   },
6377   "# Copy the host from the base URL in the following cases",
6378   {
6379     "input": "C|/",
6380     "base": "file://host/",
6381     "href": "file://host/C:/",
6382     "protocol": "file:",
6383     "username": "",
6384     "password": "",
6385     "host": "host",
6386     "hostname": "host",
6387     "port": "",
6388     "pathname": "/C:/",
6389     "search": "",
6390     "hash": ""
6391   },
6392   {
6393     "input": "/C:/",
6394     "base": "file://host/",
6395     "href": "file://host/C:/",
6396     "protocol": "file:",
6397     "username": "",
6398     "password": "",
6399     "host": "host",
6400     "hostname": "host",
6401     "port": "",
6402     "pathname": "/C:/",
6403     "search": "",
6404     "hash": ""
6405   },
6406   {
6407     "input": "file:C:/",
6408     "base": "file://host/",
6409     "href": "file://host/C:/",
6410     "protocol": "file:",
6411     "username": "",
6412     "password": "",
6413     "host": "host",
6414     "hostname": "host",
6415     "port": "",
6416     "pathname": "/C:/",
6417     "search": "",
6418     "hash": ""
6419   },
6420   {
6421     "input": "file:/C:/",
6422     "base": "file://host/",
6423     "href": "file://host/C:/",
6424     "protocol": "file:",
6425     "username": "",
6426     "password": "",
6427     "host": "host",
6428     "hostname": "host",
6429     "port": "",
6430     "pathname": "/C:/",
6431     "search": "",
6432     "hash": ""
6433   },
6434   "# Copy the empty host from the input in the following cases",
6435   {
6436     "input": "//C:/",
6437     "base": "file://host/",
6438     "href": "file:///C:/",
6439     "protocol": "file:",
6440     "username": "",
6441     "password": "",
6442     "host": "",
6443     "hostname": "",
6444     "port": "",
6445     "pathname": "/C:/",
6446     "search": "",
6447     "hash": ""
6448   },
6449   {
6450     "input": "file://C:/",
6451     "base": "file://host/",
6452     "href": "file:///C:/",
6453     "protocol": "file:",
6454     "username": "",
6455     "password": "",
6456     "host": "",
6457     "hostname": "",
6458     "port": "",
6459     "pathname": "/C:/",
6460     "search": "",
6461     "hash": ""
6462   },
6463   {
6464     "input": "///C:/",
6465     "base": "file://host/",
6466     "href": "file:///C:/",
6467     "protocol": "file:",
6468     "username": "",
6469     "password": "",
6470     "host": "",
6471     "hostname": "",
6472     "port": "",
6473     "pathname": "/C:/",
6474     "search": "",
6475     "hash": ""
6476   },
6477   {
6478     "input": "file:///C:/",
6479     "base": "file://host/",
6480     "href": "file:///C:/",
6481     "protocol": "file:",
6482     "username": "",
6483     "password": "",
6484     "host": "",
6485     "hostname": "",
6486     "port": "",
6487     "pathname": "/C:/",
6488     "search": "",
6489     "hash": ""
6490   },
6491   "# Windows drive letter quirk (no host)",
6492   {
6493     "input": "file:/C|/",
6494     "base": null,
6495     "href": "file:///C:/",
6496     "protocol": "file:",
6497     "username": "",
6498     "password": "",
6499     "host": "",
6500     "hostname": "",
6501     "port": "",
6502     "pathname": "/C:/",
6503     "search": "",
6504     "hash": ""
6505   },
6506   {
6507     "input": "file://C|/",
6508     "base": null,
6509     "href": "file:///C:/",
6510     "protocol": "file:",
6511     "username": "",
6512     "password": "",
6513     "host": "",
6514     "hostname": "",
6515     "port": "",
6516     "pathname": "/C:/",
6517     "search": "",
6518     "hash": ""
6519   },
6520   "# file URLs without base URL by Rimas Misevičius",
6521   {
6522     "input": "file:",
6523     "base": null,
6524     "href": "file:///",
6525     "protocol": "file:",
6526     "username": "",
6527     "password": "",
6528     "host": "",
6529     "hostname": "",
6530     "port": "",
6531     "pathname": "/",
6532     "search": "",
6533     "hash": ""
6534   },
6535   {
6536     "input": "file:?q=v",
6537     "base": null,
6538     "href": "file:///?q=v",
6539     "protocol": "file:",
6540     "username": "",
6541     "password": "",
6542     "host": "",
6543     "hostname": "",
6544     "port": "",
6545     "pathname": "/",
6546     "search": "?q=v",
6547     "hash": ""
6548   },
6549   {
6550     "input": "file:#frag",
6551     "base": null,
6552     "href": "file:///#frag",
6553     "protocol": "file:",
6554     "username": "",
6555     "password": "",
6556     "host": "",
6557     "hostname": "",
6558     "port": "",
6559     "pathname": "/",
6560     "search": "",
6561     "hash": "#frag"
6562   },
6563   "# file: drive letter cases from https://crbug.com/1078698",
6564   {
6565     "input": "file:///Y:",
6566     "base": null,
6567     "href": "file:///Y:",
6568     "protocol": "file:",
6569     "username": "",
6570     "password": "",
6571     "host": "",
6572     "hostname": "",
6573     "port": "",
6574     "pathname": "/Y:",
6575     "search": "",
6576     "hash": ""
6577   },
6578   {
6579     "input": "file:///Y:/",
6580     "base": null,
6581     "href": "file:///Y:/",
6582     "protocol": "file:",
6583     "username": "",
6584     "password": "",
6585     "host": "",
6586     "hostname": "",
6587     "port": "",
6588     "pathname": "/Y:/",
6589     "search": "",
6590     "hash": ""
6591   },
6592   {
6593     "input": "file:///./Y",
6594     "base": null,
6595     "href": "file:///Y",
6596     "protocol": "file:",
6597     "username": "",
6598     "password": "",
6599     "host": "",
6600     "hostname": "",
6601     "port": "",
6602     "pathname": "/Y",
6603     "search": "",
6604     "hash": ""
6605   },
6606   {
6607     "input": "file:///./Y:",
6608     "base": null,
6609     "href": "file:///Y:",
6610     "protocol": "file:",
6611     "username": "",
6612     "password": "",
6613     "host": "",
6614     "hostname": "",
6615     "port": "",
6616     "pathname": "/Y:",
6617     "search": "",
6618     "hash": ""
6619   },
6620   {
6621     "input": "\\\\\\.\\Y:",
6622     "base": null,
6623     "failure": true,
6624     "relativeTo": "non-opaque-path-base"
6625   },
6626   "# file: drive letter cases from https://crbug.com/1078698 but lowercased",
6627   {
6628     "input": "file:///y:",
6629     "base": null,
6630     "href": "file:///y:",
6631     "protocol": "file:",
6632     "username": "",
6633     "password": "",
6634     "host": "",
6635     "hostname": "",
6636     "port": "",
6637     "pathname": "/y:",
6638     "search": "",
6639     "hash": ""
6640   },
6641   {
6642     "input": "file:///y:/",
6643     "base": null,
6644     "href": "file:///y:/",
6645     "protocol": "file:",
6646     "username": "",
6647     "password": "",
6648     "host": "",
6649     "hostname": "",
6650     "port": "",
6651     "pathname": "/y:/",
6652     "search": "",
6653     "hash": ""
6654   },
6655   {
6656     "input": "file:///./y",
6657     "base": null,
6658     "href": "file:///y",
6659     "protocol": "file:",
6660     "username": "",
6661     "password": "",
6662     "host": "",
6663     "hostname": "",
6664     "port": "",
6665     "pathname": "/y",
6666     "search": "",
6667     "hash": ""
6668   },
6669   {
6670     "input": "file:///./y:",
6671     "base": null,
6672     "href": "file:///y:",
6673     "protocol": "file:",
6674     "username": "",
6675     "password": "",
6676     "host": "",
6677     "hostname": "",
6678     "port": "",
6679     "pathname": "/y:",
6680     "search": "",
6681     "hash": ""
6682   },
6683   {
6684     "input": "\\\\\\.\\y:",
6685     "base": null,
6686     "failure": true,
6687     "relativeTo": "non-opaque-path-base"
6688   },
6689   "# Additional file URL tests for (https://github.com/whatwg/url/issues/405)",
6690   {
6691     "input": "file://localhost//a//../..//foo",
6692     "base": null,
6693     "href": "file://///foo",
6694     "protocol": "file:",
6695     "username": "",
6696     "password": "",
6697     "host": "",
6698     "hostname": "",
6699     "port": "",
6700     "pathname": "///foo",
6701     "search": "",
6702     "hash": ""
6703   },
6704   {
6705     "input": "file://localhost////foo",
6706     "base": null,
6707     "href": "file://////foo",
6708     "protocol": "file:",
6709     "username": "",
6710     "password": "",
6711     "host": "",
6712     "hostname": "",
6713     "port": "",
6714     "pathname": "////foo",
6715     "search": "",
6716     "hash": ""
6717   },
6718   {
6719     "input": "file:////foo",
6720     "base": null,
6721     "href": "file:////foo",
6722     "protocol": "file:",
6723     "username": "",
6724     "password": "",
6725     "host": "",
6726     "hostname": "",
6727     "port": "",
6728     "pathname": "//foo",
6729     "search": "",
6730     "hash": ""
6731   },
6732   {
6733     "input": "file:///one/two",
6734     "base": "file:///",
6735     "href": "file:///one/two",
6736     "protocol": "file:",
6737     "username": "",
6738     "password": "",
6739     "host": "",
6740     "hostname": "",
6741     "port": "",
6742     "pathname": "/one/two",
6743     "search": "",
6744     "hash": ""
6745   },
6746   {
6747     "input": "file:////one/two",
6748     "base": "file:///",
6749     "href": "file:////one/two",
6750     "protocol": "file:",
6751     "username": "",
6752     "password": "",
6753     "host": "",
6754     "hostname": "",
6755     "port": "",
6756     "pathname": "//one/two",
6757     "search": "",
6758     "hash": ""
6759   },
6760   {
6761     "input": "//one/two",
6762     "base": "file:///",
6763     "href": "file://one/two",
6764     "protocol": "file:",
6765     "username": "",
6766     "password": "",
6767     "host": "one",
6768     "hostname": "one",
6769     "port": "",
6770     "pathname": "/two",
6771     "search": "",
6772     "hash": ""
6773   },
6774   {
6775     "input": "///one/two",
6776     "base": "file:///",
6777     "href": "file:///one/two",
6778     "protocol": "file:",
6779     "username": "",
6780     "password": "",
6781     "host": "",
6782     "hostname": "",
6783     "port": "",
6784     "pathname": "/one/two",
6785     "search": "",
6786     "hash": ""
6787   },
6788   {
6789     "input": "////one/two",
6790     "base": "file:///",
6791     "href": "file:////one/two",
6792     "protocol": "file:",
6793     "username": "",
6794     "password": "",
6795     "host": "",
6796     "hostname": "",
6797     "port": "",
6798     "pathname": "//one/two",
6799     "search": "",
6800     "hash": ""
6801   },
6802   {
6803     "input": "file:///.//",
6804     "base": "file:////",
6805     "href": "file:////",
6806     "protocol": "file:",
6807     "username": "",
6808     "password": "",
6809     "host": "",
6810     "hostname": "",
6811     "port": "",
6812     "pathname": "//",
6813     "search": "",
6814     "hash": ""
6815   },
6816   "File URL tests for https://github.com/whatwg/url/issues/549",
6817   {
6818     "input": "file:.//p",
6819     "base": null,
6820     "href": "file:////p",
6821     "protocol": "file:",
6822     "username": "",
6823     "password": "",
6824     "host": "",
6825     "hostname": "",
6826     "port": "",
6827     "pathname": "//p",
6828     "search": "",
6829     "hash": ""
6830   },
6831   {
6832     "input": "file:/.//p",
6833     "base": null,
6834     "href": "file:////p",
6835     "protocol": "file:",
6836     "username": "",
6837     "password": "",
6838     "host": "",
6839     "hostname": "",
6840     "port": "",
6841     "pathname": "//p",
6842     "search": "",
6843     "hash": ""
6844   },
6845   "# IPv6 tests",
6846   {
6847     "input": "http://[1:0::]",
6848     "base": "http://example.net/",
6849     "href": "http://[1::]/",
6850     "origin": "http://[1::]",
6851     "protocol": "http:",
6852     "username": "",
6853     "password": "",
6854     "host": "[1::]",
6855     "hostname": "[1::]",
6856     "port": "",
6857     "pathname": "/",
6858     "search": "",
6859     "hash": ""
6860   },
6861   {
6862     "input": "http://[0:1:2:3:4:5:6:7:8]",
6863     "base": "http://example.net/",
6864     "failure": true
6865   },
6866   {
6867     "input": "https://[0::0::0]",
6868     "base": null,
6869     "failure": true
6870   },
6871   {
6872     "input": "https://[0:.0]",
6873     "base": null,
6874     "failure": true
6875   },
6876   {
6877     "input": "https://[0:0:]",
6878     "base": null,
6879     "failure": true
6880   },
6881   {
6882     "input": "https://[0:1:2:3:4:5:6:7.0.0.0.1]",
6883     "base": null,
6884     "failure": true
6885   },
6886   {
6887     "input": "https://[0:1.00.0.0.0]",
6888     "base": null,
6889     "failure": true
6890   },
6891   {
6892     "input": "https://[0:1.290.0.0.0]",
6893     "base": null,
6894     "failure": true
6895   },
6896   {
6897     "input": "https://[0:1.23.23]",
6898     "base": null,
6899     "failure": true
6900   },
6901   "# Empty host",
6902   {
6903     "input": "http://?",
6904     "base": null,
6905     "failure": true
6906   },
6907   {
6908     "input": "http://#",
6909     "base": null,
6910     "failure": true
6911   },
6912   "Port overflow (2^32 + 81)",
6913   {
6914     "input": "http://f:4294967377/c",
6915     "base": "http://example.org/",
6916     "failure": true
6917   },
6918   "Port overflow (2^64 + 81)",
6919   {
6920     "input": "http://f:18446744073709551697/c",
6921     "base": "http://example.org/",
6922     "failure": true
6923   },
6924   "Port overflow (2^128 + 81)",
6925   {
6926     "input": "http://f:340282366920938463463374607431768211537/c",
6927     "base": "http://example.org/",
6928     "failure": true
6929   },
6930   "# Non-special-URL path tests",
6931   {
6932     "input": "sc://ñ",
6933     "base": null,
6934     "href": "sc://%C3%B1",
6935     "origin": "null",
6936     "protocol": "sc:",
6937     "username": "",
6938     "password": "",
6939     "host": "%C3%B1",
6940     "hostname": "%C3%B1",
6941     "port": "",
6942     "pathname": "",
6943     "search": "",
6944     "hash": ""
6945   },
6946   {
6947     "input": "sc://ñ?x",
6948     "base": null,
6949     "href": "sc://%C3%B1?x",
6950     "origin": "null",
6951     "protocol": "sc:",
6952     "username": "",
6953     "password": "",
6954     "host": "%C3%B1",
6955     "hostname": "%C3%B1",
6956     "port": "",
6957     "pathname": "",
6958     "search": "?x",
6959     "hash": ""
6960   },
6961   {
6962     "input": "sc://ñ#x",
6963     "base": null,
6964     "href": "sc://%C3%B1#x",
6965     "origin": "null",
6966     "protocol": "sc:",
6967     "username": "",
6968     "password": "",
6969     "host": "%C3%B1",
6970     "hostname": "%C3%B1",
6971     "port": "",
6972     "pathname": "",
6973     "search": "",
6974     "hash": "#x"
6975   },
6976   {
6977     "input": "#x",
6978     "base": "sc://ñ",
6979     "href": "sc://%C3%B1#x",
6980     "origin": "null",
6981     "protocol": "sc:",
6982     "username": "",
6983     "password": "",
6984     "host": "%C3%B1",
6985     "hostname": "%C3%B1",
6986     "port": "",
6987     "pathname": "",
6988     "search": "",
6989     "hash": "#x"
6990   },
6991   {
6992     "input": "?x",
6993     "base": "sc://ñ",
6994     "href": "sc://%C3%B1?x",
6995     "origin": "null",
6996     "protocol": "sc:",
6997     "username": "",
6998     "password": "",
6999     "host": "%C3%B1",
7000     "hostname": "%C3%B1",
7001     "port": "",
7002     "pathname": "",
7003     "search": "?x",
7004     "hash": ""
7005   },
7006   {
7007     "input": "sc://?",
7008     "base": null,
7009     "href": "sc://?",
7010     "protocol": "sc:",
7011     "username": "",
7012     "password": "",
7013     "host": "",
7014     "hostname": "",
7015     "port": "",
7016     "pathname": "",
7017     "search": "",
7018     "hash": ""
7019   },
7020   {
7021     "input": "sc://#",
7022     "base": null,
7023     "href": "sc://#",
7024     "protocol": "sc:",
7025     "username": "",
7026     "password": "",
7027     "host": "",
7028     "hostname": "",
7029     "port": "",
7030     "pathname": "",
7031     "search": "",
7032     "hash": ""
7033   },
7034   {
7035     "input": "///",
7036     "base": "sc://x/",
7037     "href": "sc:///",
7038     "protocol": "sc:",
7039     "username": "",
7040     "password": "",
7041     "host": "",
7042     "hostname": "",
7043     "port": "",
7044     "pathname": "/",
7045     "search": "",
7046     "hash": ""
7047   },
7048   {
7049     "input": "////",
7050     "base": "sc://x/",
7051     "href": "sc:////",
7052     "protocol": "sc:",
7053     "username": "",
7054     "password": "",
7055     "host": "",
7056     "hostname": "",
7057     "port": "",
7058     "pathname": "//",
7059     "search": "",
7060     "hash": ""
7061   },
7062   {
7063     "input": "////x/",
7064     "base": "sc://x/",
7065     "href": "sc:////x/",
7066     "protocol": "sc:",
7067     "username": "",
7068     "password": "",
7069     "host": "",
7070     "hostname": "",
7071     "port": "",
7072     "pathname": "//x/",
7073     "search": "",
7074     "hash": ""
7075   },
7076   {
7077     "input": "tftp://foobar.com/someconfig;mode=netascii",
7078     "base": null,
7079     "href": "tftp://foobar.com/someconfig;mode=netascii",
7080     "origin": "null",
7081     "protocol": "tftp:",
7082     "username": "",
7083     "password": "",
7084     "host": "foobar.com",
7085     "hostname": "foobar.com",
7086     "port": "",
7087     "pathname": "/someconfig;mode=netascii",
7088     "search": "",
7089     "hash": ""
7090   },
7091   {
7092     "input": "telnet://user:pass@foobar.com:23/",
7093     "base": null,
7094     "href": "telnet://user:pass@foobar.com:23/",
7095     "origin": "null",
7096     "protocol": "telnet:",
7097     "username": "user",
7098     "password": "pass",
7099     "host": "foobar.com:23",
7100     "hostname": "foobar.com",
7101     "port": "23",
7102     "pathname": "/",
7103     "search": "",
7104     "hash": ""
7105   },
7106   {
7107     "input": "ut2004://10.10.10.10:7777/Index.ut2",
7108     "base": null,
7109     "href": "ut2004://10.10.10.10:7777/Index.ut2",
7110     "origin": "null",
7111     "protocol": "ut2004:",
7112     "username": "",
7113     "password": "",
7114     "host": "10.10.10.10:7777",
7115     "hostname": "10.10.10.10",
7116     "port": "7777",
7117     "pathname": "/Index.ut2",
7118     "search": "",
7119     "hash": ""
7120   },
7121   {
7122     "input": "redis://foo:bar@somehost:6379/0?baz=bam&qux=baz",
7123     "base": null,
7124     "href": "redis://foo:bar@somehost:6379/0?baz=bam&qux=baz",
7125     "origin": "null",
7126     "protocol": "redis:",
7127     "username": "foo",
7128     "password": "bar",
7129     "host": "somehost:6379",
7130     "hostname": "somehost",
7131     "port": "6379",
7132     "pathname": "/0",
7133     "search": "?baz=bam&qux=baz",
7134     "hash": ""
7135   },
7136   {
7137     "input": "rsync://foo@host:911/sup",
7138     "base": null,
7139     "href": "rsync://foo@host:911/sup",
7140     "origin": "null",
7141     "protocol": "rsync:",
7142     "username": "foo",
7143     "password": "",
7144     "host": "host:911",
7145     "hostname": "host",
7146     "port": "911",
7147     "pathname": "/sup",
7148     "search": "",
7149     "hash": ""
7150   },
7151   {
7152     "input": "git://github.com/foo/bar.git",
7153     "base": null,
7154     "href": "git://github.com/foo/bar.git",
7155     "origin": "null",
7156     "protocol": "git:",
7157     "username": "",
7158     "password": "",
7159     "host": "github.com",
7160     "hostname": "github.com",
7161     "port": "",
7162     "pathname": "/foo/bar.git",
7163     "search": "",
7164     "hash": ""
7165   },
7166   {
7167     "input": "irc://myserver.com:6999/channel?passwd",
7168     "base": null,
7169     "href": "irc://myserver.com:6999/channel?passwd",
7170     "origin": "null",
7171     "protocol": "irc:",
7172     "username": "",
7173     "password": "",
7174     "host": "myserver.com:6999",
7175     "hostname": "myserver.com",
7176     "port": "6999",
7177     "pathname": "/channel",
7178     "search": "?passwd",
7179     "hash": ""
7180   },
7181   {
7182     "input": "dns://fw.example.org:9999/foo.bar.org?type=TXT",
7183     "base": null,
7184     "href": "dns://fw.example.org:9999/foo.bar.org?type=TXT",
7185     "origin": "null",
7186     "protocol": "dns:",
7187     "username": "",
7188     "password": "",
7189     "host": "fw.example.org:9999",
7190     "hostname": "fw.example.org",
7191     "port": "9999",
7192     "pathname": "/foo.bar.org",
7193     "search": "?type=TXT",
7194     "hash": ""
7195   },
7196   {
7197     "input": "ldap://localhost:389/ou=People,o=JNDITutorial",
7198     "base": null,
7199     "href": "ldap://localhost:389/ou=People,o=JNDITutorial",
7200     "origin": "null",
7201     "protocol": "ldap:",
7202     "username": "",
7203     "password": "",
7204     "host": "localhost:389",
7205     "hostname": "localhost",
7206     "port": "389",
7207     "pathname": "/ou=People,o=JNDITutorial",
7208     "search": "",
7209     "hash": ""
7210   },
7211   {
7212     "input": "git+https://github.com/foo/bar",
7213     "base": null,
7214     "href": "git+https://github.com/foo/bar",
7215     "origin": "null",
7216     "protocol": "git+https:",
7217     "username": "",
7218     "password": "",
7219     "host": "github.com",
7220     "hostname": "github.com",
7221     "port": "",
7222     "pathname": "/foo/bar",
7223     "search": "",
7224     "hash": ""
7225   },
7226   {
7227     "input": "urn:ietf:rfc:2648",
7228     "base": null,
7229     "href": "urn:ietf:rfc:2648",
7230     "origin": "null",
7231     "protocol": "urn:",
7232     "username": "",
7233     "password": "",
7234     "host": "",
7235     "hostname": "",
7236     "port": "",
7237     "pathname": "ietf:rfc:2648",
7238     "search": "",
7239     "hash": ""
7240   },
7241   {
7242     "input": "tag:joe@example.org,2001:foo/bar",
7243     "base": null,
7244     "href": "tag:joe@example.org,2001:foo/bar",
7245     "origin": "null",
7246     "protocol": "tag:",
7247     "username": "",
7248     "password": "",
7249     "host": "",
7250     "hostname": "",
7251     "port": "",
7252     "pathname": "joe@example.org,2001:foo/bar",
7253     "search": "",
7254     "hash": ""
7255   },
7256   "Serialize /. in path",
7257   {
7258     "input": "non-spec:/.//",
7259     "base": null,
7260     "href": "non-spec:/.//",
7261     "protocol": "non-spec:",
7262     "username": "",
7263     "password": "",
7264     "host": "",
7265     "hostname": "",
7266     "port": "",
7267     "pathname": "//",
7268     "search": "",
7269     "hash": ""
7270   },
7271   {
7272     "input": "non-spec:/..//",
7273     "base": null,
7274     "href": "non-spec:/.//",
7275     "protocol": "non-spec:",
7276     "username": "",
7277     "password": "",
7278     "host": "",
7279     "hostname": "",
7280     "port": "",
7281     "pathname": "//",
7282     "search": "",
7283     "hash": ""
7284   },
7285   {
7286     "input": "non-spec:/a/..//",
7287     "base": null,
7288     "href": "non-spec:/.//",
7289     "protocol": "non-spec:",
7290     "username": "",
7291     "password": "",
7292     "host": "",
7293     "hostname": "",
7294     "port": "",
7295     "pathname": "//",
7296     "search": "",
7297     "hash": ""
7298   },
7299   {
7300     "input": "non-spec:/.//path",
7301     "base": null,
7302     "href": "non-spec:/.//path",
7303     "protocol": "non-spec:",
7304     "username": "",
7305     "password": "",
7306     "host": "",
7307     "hostname": "",
7308     "port": "",
7309     "pathname": "//path",
7310     "search": "",
7311     "hash": ""
7312   },
7313   {
7314     "input": "non-spec:/..//path",
7315     "base": null,
7316     "href": "non-spec:/.//path",
7317     "protocol": "non-spec:",
7318     "username": "",
7319     "password": "",
7320     "host": "",
7321     "hostname": "",
7322     "port": "",
7323     "pathname": "//path",
7324     "search": "",
7325     "hash": ""
7326   },
7327   {
7328     "input": "non-spec:/a/..//path",
7329     "base": null,
7330     "href": "non-spec:/.//path",
7331     "protocol": "non-spec:",
7332     "username": "",
7333     "password": "",
7334     "host": "",
7335     "hostname": "",
7336     "port": "",
7337     "pathname": "//path",
7338     "search": "",
7339     "hash": ""
7340   },
7341   {
7342     "input": "/.//path",
7343     "base": "non-spec:/p",
7344     "href": "non-spec:/.//path",
7345     "protocol": "non-spec:",
7346     "username": "",
7347     "password": "",
7348     "host": "",
7349     "hostname": "",
7350     "port": "",
7351     "pathname": "//path",
7352     "search": "",
7353     "hash": ""
7354   },
7355   {
7356     "input": "/..//path",
7357     "base": "non-spec:/p",
7358     "href": "non-spec:/.//path",
7359     "protocol": "non-spec:",
7360     "username": "",
7361     "password": "",
7362     "host": "",
7363     "hostname": "",
7364     "port": "",
7365     "pathname": "//path",
7366     "search": "",
7367     "hash": ""
7368   },
7369   {
7370     "input": "..//path",
7371     "base": "non-spec:/p",
7372     "href": "non-spec:/.//path",
7373     "protocol": "non-spec:",
7374     "username": "",
7375     "password": "",
7376     "host": "",
7377     "hostname": "",
7378     "port": "",
7379     "pathname": "//path",
7380     "search": "",
7381     "hash": ""
7382   },
7383   {
7384     "input": "a/..//path",
7385     "base": "non-spec:/p",
7386     "href": "non-spec:/.//path",
7387     "protocol": "non-spec:",
7388     "username": "",
7389     "password": "",
7390     "host": "",
7391     "hostname": "",
7392     "port": "",
7393     "pathname": "//path",
7394     "search": "",
7395     "hash": ""
7396   },
7397   {
7398     "input": "",
7399     "base": "non-spec:/..//p",
7400     "href": "non-spec:/.//p",
7401     "protocol": "non-spec:",
7402     "username": "",
7403     "password": "",
7404     "host": "",
7405     "hostname": "",
7406     "port": "",
7407     "pathname": "//p",
7408     "search": "",
7409     "hash": ""
7410   },
7411   {
7412     "input": "path",
7413     "base": "non-spec:/..//p",
7414     "href": "non-spec:/.//path",
7415     "protocol": "non-spec:",
7416     "username": "",
7417     "password": "",
7418     "host": "",
7419     "hostname": "",
7420     "port": "",
7421     "pathname": "//path",
7422     "search": "",
7423     "hash": ""
7424   },
7425   "Do not serialize /. in path",
7426   {
7427     "input": "../path",
7428     "base": "non-spec:/.//p",
7429     "href": "non-spec:/path",
7430     "protocol": "non-spec:",
7431     "username": "",
7432     "password": "",
7433     "host": "",
7434     "hostname": "",
7435     "port": "",
7436     "pathname": "/path",
7437     "search": "",
7438     "hash": ""
7439   },
7440   "# percent encoded hosts in non-special-URLs",
7441   {
7442     "input": "non-special://%E2%80%A0/",
7443     "base": null,
7444     "href": "non-special://%E2%80%A0/",
7445     "protocol": "non-special:",
7446     "username": "",
7447     "password": "",
7448     "host": "%E2%80%A0",
7449     "hostname": "%E2%80%A0",
7450     "port": "",
7451     "pathname": "/",
7452     "search": "",
7453     "hash": ""
7454   },
7455   {
7456     "input": "non-special://H%4fSt/path",
7457     "base": null,
7458     "href": "non-special://H%4fSt/path",
7459     "protocol": "non-special:",
7460     "username": "",
7461     "password": "",
7462     "host": "H%4fSt",
7463     "hostname": "H%4fSt",
7464     "port": "",
7465     "pathname": "/path",
7466     "search": "",
7467     "hash": ""
7468   },
7469   "# IPv6 in non-special-URLs",
7470   {
7471     "input": "non-special://[1:2:0:0:5:0:0:0]/",
7472     "base": null,
7473     "href": "non-special://[1:2:0:0:5::]/",
7474     "protocol": "non-special:",
7475     "username": "",
7476     "password": "",
7477     "host": "[1:2:0:0:5::]",
7478     "hostname": "[1:2:0:0:5::]",
7479     "port": "",
7480     "pathname": "/",
7481     "search": "",
7482     "hash": ""
7483   },
7484   {
7485     "input": "non-special://[1:2:0:0:0:0:0:3]/",
7486     "base": null,
7487     "href": "non-special://[1:2::3]/",
7488     "protocol": "non-special:",
7489     "username": "",
7490     "password": "",
7491     "host": "[1:2::3]",
7492     "hostname": "[1:2::3]",
7493     "port": "",
7494     "pathname": "/",
7495     "search": "",
7496     "hash": ""
7497   },
7498   {
7499     "input": "non-special://[1:2::3]:80/",
7500     "base": null,
7501     "href": "non-special://[1:2::3]:80/",
7502     "protocol": "non-special:",
7503     "username": "",
7504     "password": "",
7505     "host": "[1:2::3]:80",
7506     "hostname": "[1:2::3]",
7507     "port": "80",
7508     "pathname": "/",
7509     "search": "",
7510     "hash": ""
7511   },
7512   {
7513     "input": "non-special://[:80/",
7514     "base": null,
7515     "failure": true
7516   },
7517   {
7518     "input": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf",
7519     "base": null,
7520     "href": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf",
7521     "origin": "null",
7522     "protocol": "blob:",
7523     "username": "",
7524     "password": "",
7525     "host": "",
7526     "hostname": "",
7527     "port": "",
7528     "pathname": "d3958f5c-0777-0845-9dcf-2cb28783acaf",
7529     "search": "",
7530     "hash": ""
7531   },
7532   {
7533     "input": "blob:",
7534     "base": null,
7535     "href": "blob:",
7536     "origin": "null",
7537     "protocol": "blob:",
7538     "username": "",
7539     "password": "",
7540     "host": "",
7541     "hostname": "",
7542     "port": "",
7543     "pathname": "",
7544     "search": "",
7545     "hash": ""
7546   },
7547   "Invalid IPv4 radix digits",
7548   {
7549     "input": "http://0x7f.0.0.0x7g",
7550     "base": null,
7551     "href": "http://0x7f.0.0.0x7g/",
7552     "protocol": "http:",
7553     "username": "",
7554     "password": "",
7555     "host": "0x7f.0.0.0x7g",
7556     "hostname": "0x7f.0.0.0x7g",
7557     "port": "",
7558     "pathname": "/",
7559     "search": "",
7560     "hash": ""
7561   },
7562   {
7563     "input": "http://0X7F.0.0.0X7G",
7564     "base": null,
7565     "href": "http://0x7f.0.0.0x7g/",
7566     "protocol": "http:",
7567     "username": "",
7568     "password": "",
7569     "host": "0x7f.0.0.0x7g",
7570     "hostname": "0x7f.0.0.0x7g",
7571     "port": "",
7572     "pathname": "/",
7573     "search": "",
7574     "hash": ""
7575   },
7576   "Invalid IPv4 portion of IPv6 address",
7577   {
7578     "input": "http://[::127.0.0.0.1]",
7579     "base": null,
7580     "failure": true
7581   },
7582   "Uncompressed IPv6 addresses with 0",
7583   {
7584     "input": "http://[0:1:0:1:0:1:0:1]",
7585     "base": null,
7586     "href": "http://[0:1:0:1:0:1:0:1]/",
7587     "protocol": "http:",
7588     "username": "",
7589     "password": "",
7590     "host": "[0:1:0:1:0:1:0:1]",
7591     "hostname": "[0:1:0:1:0:1:0:1]",
7592     "port": "",
7593     "pathname": "/",
7594     "search": "",
7595     "hash": ""
7596   },
7597   {
7598     "input": "http://[1:0:1:0:1:0:1:0]",
7599     "base": null,
7600     "href": "http://[1:0:1:0:1:0:1:0]/",
7601     "protocol": "http:",
7602     "username": "",
7603     "password": "",
7604     "host": "[1:0:1:0:1:0:1:0]",
7605     "hostname": "[1:0:1:0:1:0:1:0]",
7606     "port": "",
7607     "pathname": "/",
7608     "search": "",
7609     "hash": ""
7610   },
7611   "Percent-encoded query and fragment",
7612   {
7613     "input": "http://example.org/test?\u0022",
7614     "base": null,
7615     "href": "http://example.org/test?%22",
7616     "protocol": "http:",
7617     "username": "",
7618     "password": "",
7619     "host": "example.org",
7620     "hostname": "example.org",
7621     "port": "",
7622     "pathname": "/test",
7623     "search": "?%22",
7624     "hash": ""
7625   },
7626   {
7627     "input": "http://example.org/test?\u0023",
7628     "base": null,
7629     "href": "http://example.org/test?#",
7630     "protocol": "http:",
7631     "username": "",
7632     "password": "",
7633     "host": "example.org",
7634     "hostname": "example.org",
7635     "port": "",
7636     "pathname": "/test",
7637     "search": "",
7638     "hash": ""
7639   },
7640   {
7641     "input": "http://example.org/test?\u003C",
7642     "base": null,
7643     "href": "http://example.org/test?%3C",
7644     "protocol": "http:",
7645     "username": "",
7646     "password": "",
7647     "host": "example.org",
7648     "hostname": "example.org",
7649     "port": "",
7650     "pathname": "/test",
7651     "search": "?%3C",
7652     "hash": ""
7653   },
7654   {
7655     "input": "http://example.org/test?\u003E",
7656     "base": null,
7657     "href": "http://example.org/test?%3E",
7658     "protocol": "http:",
7659     "username": "",
7660     "password": "",
7661     "host": "example.org",
7662     "hostname": "example.org",
7663     "port": "",
7664     "pathname": "/test",
7665     "search": "?%3E",
7666     "hash": ""
7667   },
7668   {
7669     "input": "http://example.org/test?\u2323",
7670     "base": null,
7671     "href": "http://example.org/test?%E2%8C%A3",
7672     "protocol": "http:",
7673     "username": "",
7674     "password": "",
7675     "host": "example.org",
7676     "hostname": "example.org",
7677     "port": "",
7678     "pathname": "/test",
7679     "search": "?%E2%8C%A3",
7680     "hash": ""
7681   },
7682   {
7683     "input": "http://example.org/test?%23%23",
7684     "base": null,
7685     "href": "http://example.org/test?%23%23",
7686     "protocol": "http:",
7687     "username": "",
7688     "password": "",
7689     "host": "example.org",
7690     "hostname": "example.org",
7691     "port": "",
7692     "pathname": "/test",
7693     "search": "?%23%23",
7694     "hash": ""
7695   },
7696   {
7697     "input": "http://example.org/test?%GH",
7698     "base": null,
7699     "href": "http://example.org/test?%GH",
7700     "protocol": "http:",
7701     "username": "",
7702     "password": "",
7703     "host": "example.org",
7704     "hostname": "example.org",
7705     "port": "",
7706     "pathname": "/test",
7707     "search": "?%GH",
7708     "hash": ""
7709   },
7710   {
7711     "input": "http://example.org/test?a#%EF",
7712     "base": null,
7713     "href": "http://example.org/test?a#%EF",
7714     "protocol": "http:",
7715     "username": "",
7716     "password": "",
7717     "host": "example.org",
7718     "hostname": "example.org",
7719     "port": "",
7720     "pathname": "/test",
7721     "search": "?a",
7722     "hash": "#%EF"
7723   },
7724   {
7725     "input": "http://example.org/test?a#%GH",
7726     "base": null,
7727     "href": "http://example.org/test?a#%GH",
7728     "protocol": "http:",
7729     "username": "",
7730     "password": "",
7731     "host": "example.org",
7732     "hostname": "example.org",
7733     "port": "",
7734     "pathname": "/test",
7735     "search": "?a",
7736     "hash": "#%GH"
7737   },
7738   "URLs that require a non-about:blank base. (Also serve as invalid base tests.)",
7739   {
7740     "input": "a",
7741     "base": null,
7742     "failure": true,
7743     "relativeTo": "non-opaque-path-base"
7744   },
7745   {
7746     "input": "a/",
7747     "base": null,
7748     "failure": true,
7749     "relativeTo": "non-opaque-path-base"
7750   },
7751   {
7752     "input": "a//",
7753     "base": null,
7754     "failure": true,
7755     "relativeTo": "non-opaque-path-base"
7756   },
7757   "Bases that don't fail to parse but fail to be bases",
7758   {
7759     "input": "test-a-colon.html",
7760     "base": "a:",
7761     "failure": true
7762   },
7763   {
7764     "input": "test-a-colon-b.html",
7765     "base": "a:b",
7766     "failure": true
7767   },
7768   "Other base URL tests, that must succeed",
7769   {
7770     "input": "test-a-colon-slash.html",
7771     "base": "a:/",
7772     "href": "a:/test-a-colon-slash.html",
7773     "protocol": "a:",
7774     "username": "",
7775     "password": "",
7776     "host": "",
7777     "hostname": "",
7778     "port": "",
7779     "pathname": "/test-a-colon-slash.html",
7780     "search": "",
7781     "hash": ""
7782   },
7783   {
7784     "input": "test-a-colon-slash-slash.html",
7785     "base": "a://",
7786     "href": "a:///test-a-colon-slash-slash.html",
7787     "protocol": "a:",
7788     "username": "",
7789     "password": "",
7790     "host": "",
7791     "hostname": "",
7792     "port": "",
7793     "pathname": "/test-a-colon-slash-slash.html",
7794     "search": "",
7795     "hash": ""
7796   },
7797   {
7798     "input": "test-a-colon-slash-b.html",
7799     "base": "a:/b",
7800     "href": "a:/test-a-colon-slash-b.html",
7801     "protocol": "a:",
7802     "username": "",
7803     "password": "",
7804     "host": "",
7805     "hostname": "",
7806     "port": "",
7807     "pathname": "/test-a-colon-slash-b.html",
7808     "search": "",
7809     "hash": ""
7810   },
7811   {
7812     "input": "test-a-colon-slash-slash-b.html",
7813     "base": "a://b",
7814     "href": "a://b/test-a-colon-slash-slash-b.html",
7815     "protocol": "a:",
7816     "username": "",
7817     "password": "",
7818     "host": "b",
7819     "hostname": "b",
7820     "port": "",
7821     "pathname": "/test-a-colon-slash-slash-b.html",
7822     "search": "",
7823     "hash": ""
7824   },
7825   "Null code point in fragment",
7826   {
7827     "input": "http://example.org/test?a#b\u0000c",
7828     "base": null,
7829     "href": "http://example.org/test?a#b%00c",
7830     "protocol": "http:",
7831     "username": "",
7832     "password": "",
7833     "host": "example.org",
7834     "hostname": "example.org",
7835     "port": "",
7836     "pathname": "/test",
7837     "search": "?a",
7838     "hash": "#b%00c"
7839   },
7840   {
7841     "input": "non-spec://example.org/test?a#b\u0000c",
7842     "base": null,
7843     "href": "non-spec://example.org/test?a#b%00c",
7844     "protocol": "non-spec:",
7845     "username": "",
7846     "password": "",
7847     "host": "example.org",
7848     "hostname": "example.org",
7849     "port": "",
7850     "pathname": "/test",
7851     "search": "?a",
7852     "hash": "#b%00c"
7853   },
7854   {
7855     "input": "non-spec:/test?a#b\u0000c",
7856     "base": null,
7857     "href": "non-spec:/test?a#b%00c",
7858     "protocol": "non-spec:",
7859     "username": "",
7860     "password": "",
7861     "host": "",
7862     "hostname": "",
7863     "port": "",
7864     "pathname": "/test",
7865     "search": "?a",
7866     "hash": "#b%00c"
7867   },
7868   "First scheme char - not allowed: https://github.com/whatwg/url/issues/464",
7869   {
7870     "input": "10.0.0.7:8080/foo.html",
7871     "base": "file:///some/dir/bar.html",
7872     "href": "file:///some/dir/10.0.0.7:8080/foo.html",
7873     "protocol": "file:",
7874     "username": "",
7875     "password": "",
7876     "host": "",
7877     "hostname": "",
7878     "port": "",
7879     "pathname": "/some/dir/10.0.0.7:8080/foo.html",
7880     "search": "",
7881     "hash": ""
7882   },
7883   "Subsequent scheme chars - not allowed",
7884   {
7885     "input": "a!@$*=/foo.html",
7886     "base": "file:///some/dir/bar.html",
7887     "href": "file:///some/dir/a!@$*=/foo.html",
7888     "protocol": "file:",
7889     "username": "",
7890     "password": "",
7891     "host": "",
7892     "hostname": "",
7893     "port": "",
7894     "pathname": "/some/dir/a!@$*=/foo.html",
7895     "search": "",
7896     "hash": ""
7897   },
7898   "First and subsequent scheme chars - allowed",
7899   {
7900     "input": "a1234567890-+.:foo/bar",
7901     "base": "http://example.com/dir/file",
7902     "href": "a1234567890-+.:foo/bar",
7903     "protocol": "a1234567890-+.:",
7904     "username": "",
7905     "password": "",
7906     "host": "",
7907     "hostname": "",
7908     "port": "",
7909     "pathname": "foo/bar",
7910     "search": "",
7911     "hash": ""
7912   },
7913   "IDNA ignored code points in file URLs hosts",
7914   {
7915     "input": "file://a\u00ADb/p",
7916     "base": null,
7917     "href": "file://ab/p",
7918     "protocol": "file:",
7919     "username": "",
7920     "password": "",
7921     "host": "ab",
7922     "hostname": "ab",
7923     "port": "",
7924     "pathname": "/p",
7925     "search": "",
7926     "hash": ""
7927   },
7928   {
7929     "input": "file://a%C2%ADb/p",
7930     "base": null,
7931     "href": "file://ab/p",
7932     "protocol": "file:",
7933     "username": "",
7934     "password": "",
7935     "host": "ab",
7936     "hostname": "ab",
7937     "port": "",
7938     "pathname": "/p",
7939     "search": "",
7940     "hash": ""
7941   },
7942   "IDNA hostnames which get mapped to 'localhost'",
7943   {
7944     "input": "file://loC𝐀𝐋𝐇𝐨𝐬𝐭/usr/bin",
7945     "base": null,
7946     "href": "file:///usr/bin",
7947     "protocol": "file:",
7948     "username": "",
7949     "password": "",
7950     "host": "",
7951     "hostname": "",
7952     "port": "",
7953     "pathname": "/usr/bin",
7954     "search": "",
7955     "hash": ""
7956   },
7957   "Empty host after the domain to ASCII",
7958   {
7959     "input": "file://\u00ad/p",
7960     "base": null,
7961     "failure": true
7962   },
7963   {
7964     "input": "file://%C2%AD/p",
7965     "base": null,
7966     "failure": true
7967   },
7968   {
7969     "input": "file://xn--/p",
7970     "base": null,
7971     "failure": true
7972   },
7973   "https://bugzilla.mozilla.org/show_bug.cgi?id=1647058",
7974   {
7975     "input": "#link",
7976     "base": "https://example.org/##link",
7977     "href": "https://example.org/#link",
7978     "protocol": "https:",
7979     "username": "",
7980     "password": "",
7981     "host": "example.org",
7982     "hostname": "example.org",
7983     "port": "",
7984     "pathname": "/",
7985     "search": "",
7986     "hash": "#link"
7987   },
7988   "UTF-8 percent-encode of C0 control percent-encode set and supersets",
7989   {
7990     "input": "non-special:cannot-be-a-base-url-\u0000\u0001\u001F\u001E\u007E\u007F\u0080",
7991     "base": null,
7992     "hash": "",
7993     "host": "",
7994     "hostname": "",
7995     "href": "non-special:cannot-be-a-base-url-%00%01%1F%1E~%7F%C2%80",
7996     "origin": "null",
7997     "password": "",
7998     "pathname": "cannot-be-a-base-url-%00%01%1F%1E~%7F%C2%80",
7999     "port": "",
8000     "protocol": "non-special:",
8001     "search": "",
8002     "username": ""
8003   },
8004   {
8005     "input": "https://www.example.com/path{\u007Fpath.html?query'\u007F=query#fragment<\u007Ffragment",
8006     "base": null,
8007     "hash": "#fragment%3C%7Ffragment",
8008     "host": "www.example.com",
8009     "hostname": "www.example.com",
8010     "href": "https://www.example.com/path%7B%7Fpath.html?query%27%7F=query#fragment%3C%7Ffragment",
8011     "origin": "https://www.example.com",
8012     "password": "",
8013     "pathname": "/path%7B%7Fpath.html",
8014     "port": "",
8015     "protocol": "https:",
8016     "search": "?query%27%7F=query",
8017     "username": ""
8018   },
8019   {
8020     "input": "https://user:pass[\u007F@foo/bar",
8021     "base": "http://example.org",
8022     "hash": "",
8023     "host": "foo",
8024     "hostname": "foo",
8025     "href": "https://user:pass%5B%7F@foo/bar",
8026     "origin": "https://foo",
8027     "password": "pass%5B%7F",
8028     "pathname": "/bar",
8029     "port": "",
8030     "protocol": "https:",
8031     "search": "",
8032     "username": "user"
8033   },
8034   "Tests for the distinct percent-encode sets",
8035   {
8036     "input": "foo:// !\"$%&'()*+,-.;<=>@[\\]^_`{|}~@host/",
8037     "base": null,
8038     "hash": "",
8039     "host": "host",
8040     "hostname": "host",
8041     "href": "foo://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/",
8042     "origin": "null",
8043     "password": "",
8044     "pathname": "/",
8045     "port": "",
8046     "protocol": "foo:",
8047     "search": "",
8048     "username": "%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~"
8049   },
8050   {
8051     "input": "foo://joe: !\"$%&'()*+,-.:;<=>@[\\]^_`{|}~@host/",
8052     "base": null,
8053     "hash": "",
8054     "host": "host",
8055     "hostname": "host",
8056     "href": "foo://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/",
8057     "origin": "null",
8058     "password": "%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~",
8059     "pathname": "/",
8060     "port": "",
8061     "protocol": "foo:",
8062     "search": "",
8063     "username": "joe"
8064   },
8065   {
8066     "input": "foo://!\"$%&'()*+,-.;=_`{}~/",
8067     "base": null,
8068     "hash": "",
8069     "host": "!\"$%&'()*+,-.;=_`{}~",
8070     "hostname": "!\"$%&'()*+,-.;=_`{}~",
8071     "href": "foo://!\"$%&'()*+,-.;=_`{}~/",
8072     "origin": "null",
8073     "password": "",
8074     "pathname": "/",
8075     "port": "",
8076     "protocol": "foo:",
8077     "search": "",
8078     "username": ""
8079   },
8080   {
8081     "input": "foo://host/ !\"$%&'()*+,-./:;<=>@[\\]^_`{|}~",
8082     "base": null,
8083     "hash": "",
8084     "host": "host",
8085     "hostname": "host",
8086     "href": "foo://host/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]^_%60%7B|%7D~",
8087     "origin": "null",
8088     "password": "",
8089     "pathname": "/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]^_%60%7B|%7D~",
8090     "port": "",
8091     "protocol": "foo:",
8092     "search": "",
8093     "username": ""
8094   },
8095   {
8096     "input": "foo://host/dir/? !\"$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
8097     "base": null,
8098     "hash": "",
8099     "host": "host",
8100     "hostname": "host",
8101     "href": "foo://host/dir/?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\]^_`{|}~",
8102     "origin": "null",
8103     "password": "",
8104     "pathname": "/dir/",
8105     "port": "",
8106     "protocol": "foo:",
8107     "search": "?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\]^_`{|}~",
8108     "username": ""
8109   },
8110   {
8111     "input": "wss://host/dir/? !\"$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
8112     "base": null,
8113     "hash": "",
8114     "host": "host",
8115     "hostname": "host",
8116     "href": "wss://host/dir/?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\]^_`{|}~",
8117     "origin": "wss://host",
8118     "password": "",
8119     "pathname": "/dir/",
8120     "port": "",
8121     "protocol": "wss:",
8122     "search": "?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\]^_`{|}~",
8123     "username": ""
8124   },
8125   {
8126     "input": "foo://host/dir/# !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
8127     "base": null,
8128     "hash": "#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~",
8129     "host": "host",
8130     "hostname": "host",
8131     "href": "foo://host/dir/#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~",
8132     "origin": "null",
8133     "password": "",
8134     "pathname": "/dir/",
8135     "port": "",
8136     "protocol": "foo:",
8137     "search": "",
8138     "username": ""
8139   },
8140   "Ensure that input schemes are not ignored when resolving non-special URLs",
8141   {
8142     "input": "abc:rootless",
8143     "base": "abc://host/path",
8144     "hash": "",
8145     "host": "",
8146     "hostname": "",
8147     "href": "abc:rootless",
8148     "password": "",
8149     "pathname": "rootless",
8150     "port": "",
8151     "protocol": "abc:",
8152     "search": "",
8153     "username": ""
8154   },
8155   {
8156     "input": "abc:rootless",
8157     "base": "abc:/path",
8158     "hash": "",
8159     "host": "",
8160     "hostname": "",
8161     "href": "abc:rootless",
8162     "password": "",
8163     "pathname": "rootless",
8164     "port": "",
8165     "protocol": "abc:",
8166     "search": "",
8167     "username": ""
8168   },
8169   {
8170     "input": "abc:rootless",
8171     "base": "abc:path",
8172     "hash": "",
8173     "host": "",
8174     "hostname": "",
8175     "href": "abc:rootless",
8176     "password": "",
8177     "pathname": "rootless",
8178     "port": "",
8179     "protocol": "abc:",
8180     "search": "",
8181     "username": ""
8182   },
8183   {
8184     "input": "abc:/rooted",
8185     "base": "abc://host/path",
8186     "hash": "",
8187     "host": "",
8188     "hostname": "",
8189     "href": "abc:/rooted",
8190     "password": "",
8191     "pathname": "/rooted",
8192     "port": "",
8193     "protocol": "abc:",
8194     "search": "",
8195     "username": ""
8196   },
8197   "Empty query and fragment with blank should throw an error",
8198   {
8199     "input": "#",
8200     "base": null,
8201     "failure": true,
8202     "relativeTo": "any-base"
8203   },
8204   {
8205     "input": "?",
8206     "base": null,
8207     "failure": true,
8208     "relativeTo": "non-opaque-path-base"
8209   },
8210   "Last component looks like a number, but not valid IPv4",
8211   {
8212     "input": "http://1.2.3.4.5",
8213     "base": "http://other.com/",
8214     "failure": true
8215   },
8216   {
8217     "input": "http://1.2.3.4.5.",
8218     "base": "http://other.com/",
8219     "failure": true
8220   },
8221   {
8222     "input": "http://0..0x300/",
8223     "base": null,
8224     "failure": true
8225   },
8226   {
8227     "input": "http://0..0x300./",
8228     "base": null,
8229     "failure": true
8230   },
8231   {
8232     "input": "http://256.256.256.256.256",
8233     "base": "http://other.com/",
8234     "failure": true
8235   },
8236   {
8237     "input": "http://256.256.256.256.256.",
8238     "base": "http://other.com/",
8239     "failure": true
8240   },
8241   {
8242     "input": "http://1.2.3.08",
8243     "base": null,
8244     "failure": true
8245   },
8246   {
8247     "input": "http://1.2.3.08.",
8248     "base": null,
8249     "failure": true
8250   },
8251   {
8252     "input": "http://1.2.3.09",
8253     "base": null,
8254     "failure": true
8255   },
8256   {
8257     "input": "http://09.2.3.4",
8258     "base": null,
8259     "failure": true
8260   },
8261   {
8262     "input": "http://09.2.3.4.",
8263     "base": null,
8264     "failure": true
8265   },
8266   {
8267     "input": "http://01.2.3.4.5",
8268     "base": null,
8269     "failure": true
8270   },
8271   {
8272     "input": "http://01.2.3.4.5.",
8273     "base": null,
8274     "failure": true
8275   },
8276   {
8277     "input": "http://0x100.2.3.4",
8278     "base": null,
8279     "failure": true
8280   },
8281   {
8282     "input": "http://0x100.2.3.4.",
8283     "base": null,
8284     "failure": true
8285   },
8286   {
8287     "input": "http://0x1.2.3.4.5",
8288     "base": null,
8289     "failure": true
8290   },
8291   {
8292     "input": "http://0x1.2.3.4.5.",
8293     "base": null,
8294     "failure": true
8295   },
8296   {
8297     "input": "http://foo.1.2.3.4",
8298     "base": null,
8299     "failure": true
8300   },
8301   {
8302     "input": "http://foo.1.2.3.4.",
8303     "base": null,
8304     "failure": true
8305   },
8306   {
8307     "input": "http://foo.2.3.4",
8308     "base": null,
8309     "failure": true
8310   },
8311   {
8312     "input": "http://foo.2.3.4.",
8313     "base": null,
8314     "failure": true
8315   },
8316   {
8317     "input": "http://foo.09",
8318     "base": null,
8319     "failure": true
8320   },
8321   {
8322     "input": "http://foo.09.",
8323     "base": null,
8324     "failure": true
8325   },
8326   {
8327     "input": "http://foo.0x4",
8328     "base": null,
8329     "failure": true
8330   },
8331   {
8332     "input": "http://foo.0x4.",
8333     "base": null,
8334     "failure": true
8335   },
8336   {
8337     "input": "http://foo.09..",
8338     "base": null,
8339     "hash": "",
8340     "host": "foo.09..",
8341     "hostname": "foo.09..",
8342     "href": "http://foo.09../",
8343     "password": "",
8344     "pathname": "/",
8345     "port": "",
8346     "protocol": "http:",
8347     "search": "",
8348     "username": ""
8349   },
8350   {
8351     "input": "http://0999999999999999999/",
8352     "base": null,
8353     "failure": true
8354   },
8355   {
8356     "input": "http://foo.0x",
8357     "base": null,
8358     "failure": true
8359   },
8360   {
8361     "input": "http://foo.0XFfFfFfFfFfFfFfFfFfAcE123",
8362     "base": null,
8363     "failure": true
8364   },
8365   {
8366     "input": "http://💩.123/",
8367     "base": null,
8368     "failure": true
8369   },
8370   "U+0000 and U+FFFF in various places",
8371   {
8372     "input": "https://\u0000y",
8373     "base": null,
8374     "failure": true
8375   },
8376   {
8377     "input": "https://x/\u0000y",
8378     "base": null,
8379     "hash": "",
8380     "host": "x",
8381     "hostname": "x",
8382     "href": "https://x/%00y",
8383     "password": "",
8384     "pathname": "/%00y",
8385     "port": "",
8386     "protocol": "https:",
8387     "search": "",
8388     "username": ""
8389   },
8390   {
8391     "input": "https://x/?\u0000y",
8392     "base": null,
8393     "hash": "",
8394     "host": "x",
8395     "hostname": "x",
8396     "href": "https://x/?%00y",
8397     "password": "",
8398     "pathname": "/",
8399     "port": "",
8400     "protocol": "https:",
8401     "search": "?%00y",
8402     "username": ""
8403   },
8404   {
8405     "input": "https://x/?#\u0000y",
8406     "base": null,
8407     "hash": "#%00y",
8408     "host": "x",
8409     "hostname": "x",
8410     "href": "https://x/?#%00y",
8411     "password": "",
8412     "pathname": "/",
8413     "port": "",
8414     "protocol": "https:",
8415     "search": "",
8416     "username": ""
8417   },
8418   {
8419     "input": "https://\uFFFFy",
8420     "base": null,
8421     "failure": true
8422   },
8423   {
8424     "input": "https://x/\uFFFFy",
8425     "base": null,
8426     "hash": "",
8427     "host": "x",
8428     "hostname": "x",
8429     "href": "https://x/%EF%BF%BFy",
8430     "password": "",
8431     "pathname": "/%EF%BF%BFy",
8432     "port": "",
8433     "protocol": "https:",
8434     "search": "",
8435     "username": ""
8436   },
8437   {
8438     "input": "https://x/?\uFFFFy",
8439     "base": null,
8440     "hash": "",
8441     "host": "x",
8442     "hostname": "x",
8443     "href": "https://x/?%EF%BF%BFy",
8444     "password": "",
8445     "pathname": "/",
8446     "port": "",
8447     "protocol": "https:",
8448     "search": "?%EF%BF%BFy",
8449     "username": ""
8450   },
8451   {
8452     "input": "https://x/?#\uFFFFy",
8453     "base": null,
8454     "hash": "#%EF%BF%BFy",
8455     "host": "x",
8456     "hostname": "x",
8457     "href": "https://x/?#%EF%BF%BFy",
8458     "password": "",
8459     "pathname": "/",
8460     "port": "",
8461     "protocol": "https:",
8462     "search": "",
8463     "username": ""
8464   },
8465   {
8466     "input": "non-special:\u0000y",
8467     "base": null,
8468     "hash": "",
8469     "host": "",
8470     "hostname": "",
8471     "href": "non-special:%00y",
8472     "password": "",
8473     "pathname": "%00y",
8474     "port": "",
8475     "protocol": "non-special:",
8476     "search": "",
8477     "username": ""
8478   },
8479   {
8480     "input": "non-special:x/\u0000y",
8481     "base": null,
8482     "hash": "",
8483     "host": "",
8484     "hostname": "",
8485     "href": "non-special:x/%00y",
8486     "password": "",
8487     "pathname": "x/%00y",
8488     "port": "",
8489     "protocol": "non-special:",
8490     "search": "",
8491     "username": ""
8492   },
8493   {
8494     "input": "non-special:x/?\u0000y",
8495     "base": null,
8496     "hash": "",
8497     "host": "",
8498     "hostname": "",
8499     "href": "non-special:x/?%00y",
8500     "password": "",
8501     "pathname": "x/",
8502     "port": "",
8503     "protocol": "non-special:",
8504     "search": "?%00y",
8505     "username": ""
8506   },
8507   {
8508     "input": "non-special:x/?#\u0000y",
8509     "base": null,
8510     "hash": "#%00y",
8511     "host": "",
8512     "hostname": "",
8513     "href": "non-special:x/?#%00y",
8514     "password": "",
8515     "pathname": "x/",
8516     "port": "",
8517     "protocol": "non-special:",
8518     "search": "",
8519     "username": ""
8520   },
8521   {
8522     "input": "non-special:\uFFFFy",
8523     "base": null,
8524     "hash": "",
8525     "host": "",
8526     "hostname": "",
8527     "href": "non-special:%EF%BF%BFy",
8528     "password": "",
8529     "pathname": "%EF%BF%BFy",
8530     "port": "",
8531     "protocol": "non-special:",
8532     "search": "",
8533     "username": ""
8534   },
8535   {
8536     "input": "non-special:x/\uFFFFy",
8537     "base": null,
8538     "hash": "",
8539     "host": "",
8540     "hostname": "",
8541     "href": "non-special:x/%EF%BF%BFy",
8542     "password": "",
8543     "pathname": "x/%EF%BF%BFy",
8544     "port": "",
8545     "protocol": "non-special:",
8546     "search": "",
8547     "username": ""
8548   },
8549   {
8550     "input": "non-special:x/?\uFFFFy",
8551     "base": null,
8552     "hash": "",
8553     "host": "",
8554     "hostname": "",
8555     "href": "non-special:x/?%EF%BF%BFy",
8556     "password": "",
8557     "pathname": "x/",
8558     "port": "",
8559     "protocol": "non-special:",
8560     "search": "?%EF%BF%BFy",
8561     "username": ""
8562   },
8563   {
8564     "input": "non-special:x/?#\uFFFFy",
8565     "base": null,
8566     "hash": "#%EF%BF%BFy",
8567     "host": "",
8568     "hostname": "",
8569     "href": "non-special:x/?#%EF%BF%BFy",
8570     "password": "",
8571     "pathname": "x/",
8572     "port": "",
8573     "protocol": "non-special:",
8574     "search": "",
8575     "username": ""
8576   },
8577   {
8578     "input": "",
8579     "base": null,
8580     "failure": true,
8581     "relativeTo": "non-opaque-path-base"
8582   },
8583   {
8584     "input": "https://example.com/\"quoted\"",
8585     "base": null,
8586     "hash": "",
8587     "host": "example.com",
8588     "hostname": "example.com",
8589     "href": "https://example.com/%22quoted%22",
8590     "origin": "https://example.com",
8591     "password": "",
8592     "pathname": "/%22quoted%22",
8593     "port": "",
8594     "protocol": "https:",
8595     "search": "",
8596     "username": ""
8597   },
8598   {
8599     "input": "https://a%C2%ADb/",
8600     "base": null,
8601     "hash": "",
8602     "host": "ab",
8603     "hostname": "ab",
8604     "href": "https://ab/",
8605     "origin": "https://ab",
8606     "password": "",
8607     "pathname": "/",
8608     "port": "",
8609     "protocol": "https:",
8610     "search": "",
8611     "username": ""
8612   },
8613   {
8614     "comment": "Empty host after domain to ASCII",
8615     "input": "https://\u00AD/",
8616     "base": null,
8617     "failure": true
8618   },
8619   {
8620     "input": "https://%C2%AD/",
8621     "base": null,
8622     "failure": true
8623   },
8624   {
8625     "input": "https://xn--/",
8626     "base": null,
8627     "failure": true
8628   },
8629   "Non-special schemes that some implementations might incorrectly treat as special",
8630   {
8631     "input": "data://example.com:8080/pathname?search#hash",
8632     "base": null,
8633     "href": "data://example.com:8080/pathname?search#hash",
8634     "origin": "null",
8635     "protocol": "data:",
8636     "username": "",
8637     "password": "",
8638     "host": "example.com:8080",
8639     "hostname": "example.com",
8640     "port": "8080",
8641     "pathname": "/pathname",
8642     "search": "?search",
8643     "hash": "#hash"
8644   },
8645   {
8646     "input": "data:///test",
8647     "base": null,
8648     "href": "data:///test",
8649     "origin": "null",
8650     "protocol": "data:",
8651     "username": "",
8652     "password": "",
8653     "host": "",
8654     "hostname": "",
8655     "port": "",
8656     "pathname": "/test",
8657     "search": "",
8658     "hash": ""
8659   },
8660   {
8661     "input": "data://test/a/../b",
8662     "base": null,
8663     "href": "data://test/b",
8664     "origin": "null",
8665     "protocol": "data:",
8666     "username": "",
8667     "password": "",
8668     "host": "test",
8669     "hostname": "test",
8670     "port": "",
8671     "pathname": "/b",
8672     "search": "",
8673     "hash": ""
8674   },
8675   {
8676     "input": "data://:443",
8677     "base": null,
8678     "failure": true
8679   },
8680   {
8681     "input": "data://test:test",
8682     "base": null,
8683     "failure": true
8684   },
8685   {
8686     "input": "data://[:1]",
8687     "base": null,
8688     "failure": true
8689   },
8690   {
8691     "input": "javascript://example.com:8080/pathname?search#hash",
8692     "base": null,
8693     "href": "javascript://example.com:8080/pathname?search#hash",
8694     "origin": "null",
8695     "protocol": "javascript:",
8696     "username": "",
8697     "password": "",
8698     "host": "example.com:8080",
8699     "hostname": "example.com",
8700     "port": "8080",
8701     "pathname": "/pathname",
8702     "search": "?search",
8703     "hash": "#hash"
8704   },
8705   {
8706     "input": "javascript:///test",
8707     "base": null,
8708     "href": "javascript:///test",
8709     "origin": "null",
8710     "protocol": "javascript:",
8711     "username": "",
8712     "password": "",
8713     "host": "",
8714     "hostname": "",
8715     "port": "",
8716     "pathname": "/test",
8717     "search": "",
8718     "hash": ""
8719   },
8720   {
8721     "input": "javascript://test/a/../b",
8722     "base": null,
8723     "href": "javascript://test/b",
8724     "origin": "null",
8725     "protocol": "javascript:",
8726     "username": "",
8727     "password": "",
8728     "host": "test",
8729     "hostname": "test",
8730     "port": "",
8731     "pathname": "/b",
8732     "search": "",
8733     "hash": ""
8734   },
8735   {
8736     "input": "javascript://:443",
8737     "base": null,
8738     "failure": true
8739   },
8740   {
8741     "input": "javascript://test:test",
8742     "base": null,
8743     "failure": true
8744   },
8745   {
8746     "input": "javascript://[:1]",
8747     "base": null,
8748     "failure": true
8749   },
8750   {
8751     "input": "mailto://example.com:8080/pathname?search#hash",
8752     "base": null,
8753     "href": "mailto://example.com:8080/pathname?search#hash",
8754     "origin": "null",
8755     "protocol": "mailto:",
8756     "username": "",
8757     "password": "",
8758     "host": "example.com:8080",
8759     "hostname": "example.com",
8760     "port": "8080",
8761     "pathname": "/pathname",
8762     "search": "?search",
8763     "hash": "#hash"
8764   },
8765   {
8766     "input": "mailto:///test",
8767     "base": null,
8768     "href": "mailto:///test",
8769     "origin": "null",
8770     "protocol": "mailto:",
8771     "username": "",
8772     "password": "",
8773     "host": "",
8774     "hostname": "",
8775     "port": "",
8776     "pathname": "/test",
8777     "search": "",
8778     "hash": ""
8779   },
8780   {
8781     "input": "mailto://test/a/../b",
8782     "base": null,
8783     "href": "mailto://test/b",
8784     "origin": "null",
8785     "protocol": "mailto:",
8786     "username": "",
8787     "password": "",
8788     "host": "test",
8789     "hostname": "test",
8790     "port": "",
8791     "pathname": "/b",
8792     "search": "",
8793     "hash": ""
8794   },
8795   {
8796     "input": "mailto://:443",
8797     "base": null,
8798     "failure": true
8799   },
8800   {
8801     "input": "mailto://test:test",
8802     "base": null,
8803     "failure": true
8804   },
8805   {
8806     "input": "mailto://[:1]",
8807     "base": null,
8808     "failure": true
8809   },
8810   {
8811     "input": "intent://example.com:8080/pathname?search#hash",
8812     "base": null,
8813     "href": "intent://example.com:8080/pathname?search#hash",
8814     "origin": "null",
8815     "protocol": "intent:",
8816     "username": "",
8817     "password": "",
8818     "host": "example.com:8080",
8819     "hostname": "example.com",
8820     "port": "8080",
8821     "pathname": "/pathname",
8822     "search": "?search",
8823     "hash": "#hash"
8824   },
8825   {
8826     "input": "intent:///test",
8827     "base": null,
8828     "href": "intent:///test",
8829     "origin": "null",
8830     "protocol": "intent:",
8831     "username": "",
8832     "password": "",
8833     "host": "",
8834     "hostname": "",
8835     "port": "",
8836     "pathname": "/test",
8837     "search": "",
8838     "hash": ""
8839   },
8840   {
8841     "input": "intent://test/a/../b",
8842     "base": null,
8843     "href": "intent://test/b",
8844     "origin": "null",
8845     "protocol": "intent:",
8846     "username": "",
8847     "password": "",
8848     "host": "test",
8849     "hostname": "test",
8850     "port": "",
8851     "pathname": "/b",
8852     "search": "",
8853     "hash": ""
8854   },
8855   {
8856     "input": "intent://:443",
8857     "base": null,
8858     "failure": true
8859   },
8860   {
8861     "input": "intent://test:test",
8862     "base": null,
8863     "failure": true
8864   },
8865   {
8866     "input": "intent://[:1]",
8867     "base": null,
8868     "failure": true
8869   },
8870   {
8871     "input": "urn://example.com:8080/pathname?search#hash",
8872     "base": null,
8873     "href": "urn://example.com:8080/pathname?search#hash",
8874     "origin": "null",
8875     "protocol": "urn:",
8876     "username": "",
8877     "password": "",
8878     "host": "example.com:8080",
8879     "hostname": "example.com",
8880     "port": "8080",
8881     "pathname": "/pathname",
8882     "search": "?search",
8883     "hash": "#hash"
8884   },
8885   {
8886     "input": "urn:///test",
8887     "base": null,
8888     "href": "urn:///test",
8889     "origin": "null",
8890     "protocol": "urn:",
8891     "username": "",
8892     "password": "",
8893     "host": "",
8894     "hostname": "",
8895     "port": "",
8896     "pathname": "/test",
8897     "search": "",
8898     "hash": ""
8899   },
8900   {
8901     "input": "urn://test/a/../b",
8902     "base": null,
8903     "href": "urn://test/b",
8904     "origin": "null",
8905     "protocol": "urn:",
8906     "username": "",
8907     "password": "",
8908     "host": "test",
8909     "hostname": "test",
8910     "port": "",
8911     "pathname": "/b",
8912     "search": "",
8913     "hash": ""
8914   },
8915   {
8916     "input": "urn://:443",
8917     "base": null,
8918     "failure": true
8919   },
8920   {
8921     "input": "urn://test:test",
8922     "base": null,
8923     "failure": true
8924   },
8925   {
8926     "input": "urn://[:1]",
8927     "base": null,
8928     "failure": true
8929   },
8930   {
8931     "input": "turn://example.com:8080/pathname?search#hash",
8932     "base": null,
8933     "href": "turn://example.com:8080/pathname?search#hash",
8934     "origin": "null",
8935     "protocol": "turn:",
8936     "username": "",
8937     "password": "",
8938     "host": "example.com:8080",
8939     "hostname": "example.com",
8940     "port": "8080",
8941     "pathname": "/pathname",
8942     "search": "?search",
8943     "hash": "#hash"
8944   },
8945   {
8946     "input": "turn:///test",
8947     "base": null,
8948     "href": "turn:///test",
8949     "origin": "null",
8950     "protocol": "turn:",
8951     "username": "",
8952     "password": "",
8953     "host": "",
8954     "hostname": "",
8955     "port": "",
8956     "pathname": "/test",
8957     "search": "",
8958     "hash": ""
8959   },
8960   {
8961     "input": "turn://test/a/../b",
8962     "base": null,
8963     "href": "turn://test/b",
8964     "origin": "null",
8965     "protocol": "turn:",
8966     "username": "",
8967     "password": "",
8968     "host": "test",
8969     "hostname": "test",
8970     "port": "",
8971     "pathname": "/b",
8972     "search": "",
8973     "hash": ""
8974   },
8975   {
8976     "input": "turn://:443",
8977     "base": null,
8978     "failure": true
8979   },
8980   {
8981     "input": "turn://test:test",
8982     "base": null,
8983     "failure": true
8984   },
8985   {
8986     "input": "turn://[:1]",
8987     "base": null,
8988     "failure": true
8989   },
8990   {
8991     "input": "stun://example.com:8080/pathname?search#hash",
8992     "base": null,
8993     "href": "stun://example.com:8080/pathname?search#hash",
8994     "origin": "null",
8995     "protocol": "stun:",
8996     "username": "",
8997     "password": "",
8998     "host": "example.com:8080",
8999     "hostname": "example.com",
9000     "port": "8080",
9001     "pathname": "/pathname",
9002     "search": "?search",
9003     "hash": "#hash"
9004   },
9005   {
9006     "input": "stun:///test",
9007     "base": null,
9008     "href": "stun:///test",
9009     "origin": "null",
9010     "protocol": "stun:",
9011     "username": "",
9012     "password": "",
9013     "host": "",
9014     "hostname": "",
9015     "port": "",
9016     "pathname": "/test",
9017     "search": "",
9018     "hash": ""
9019   },
9020   {
9021     "input": "stun://test/a/../b",
9022     "base": null,
9023     "href": "stun://test/b",
9024     "origin": "null",
9025     "protocol": "stun:",
9026     "username": "",
9027     "password": "",
9028     "host": "test",
9029     "hostname": "test",
9030     "port": "",
9031     "pathname": "/b",
9032     "search": "",
9033     "hash": ""
9034   },
9035   {
9036     "input": "stun://:443",
9037     "base": null,
9038     "failure": true
9039   },
9040   {
9041     "input": "stun://test:test",
9042     "base": null,
9043     "failure": true
9044   },
9045   {
9046     "input": "stun://[:1]",
9047     "base": null,
9048     "failure": true
9049   }