@@ -20,23 +20,11 @@ namespace nix {
2020 }
2121
2222
23- std::ostream& operator <<(std::ostream& os, const ParsedURL& p) {
24- return os << " \n "
25- << " url: " << p.url << " \n "
26- << " base: " << p.base << " \n "
27- << " scheme: " << p.scheme << " \n "
28- << " authority: " << p.authority .value () << " \n "
29- << " path: " << p.path << " \n "
30- << " query: " << print_map (p.query ) << " \n "
31- << " fragment: " << p.fragment << " \n " ;
32- }
33-
3423 TEST (parseURL, parsesSimpleHttpUrl) {
3524 auto s = " http://www.example.org/file.tar.gz" ;
3625 auto parsed = parseURL (s);
3726
3827 ParsedURL expected {
39- .url = " http://www.example.org/file.tar.gz" ,
4028 .base = " http://www.example.org/file.tar.gz" ,
4129 .scheme = " http" ,
4230 .authority = " www.example.org" ,
@@ -53,7 +41,6 @@ namespace nix {
5341 auto parsed = parseURL (s);
5442
5543 ParsedURL expected {
56- .url = " https://www.example.org/file.tar.gz" ,
5744 .base = " https://www.example.org/file.tar.gz" ,
5845 .scheme = " https" ,
5946 .authority = " www.example.org" ,
@@ -70,7 +57,6 @@ namespace nix {
7057 auto parsed = parseURL (s);
7158
7259 ParsedURL expected {
73- .url = " https://www.example.org/file.tar.gz" ,
7460 .base = " https://www.example.org/file.tar.gz" ,
7561 .scheme = " https" ,
7662 .authority = " www.example.org" ,
@@ -87,7 +73,6 @@ namespace nix {
8773 auto parsed = parseURL (s);
8874
8975 ParsedURL expected {
90- .url = " http://www.example.org/file.tar.gz" ,
9176 .base = " http://www.example.org/file.tar.gz" ,
9277 .scheme = " http" ,
9378 .authority = " www.example.org" ,
@@ -104,7 +89,6 @@ namespace nix {
10489 auto parsed = parseURL (s);
10590
10691 ParsedURL expected {
107- .url = " file+https://www.example.org/video.mp4" ,
10892 .base = " https://www.example.org/video.mp4" ,
10993 .scheme = " file+https" ,
11094 .authority = " www.example.org" ,
@@ -126,7 +110,6 @@ namespace nix {
126110 auto parsed = parseURL (s);
127111
128112 ParsedURL expected {
129- .url = " http://127.0.0.1:8080/file.tar.gz" ,
130113 .base = " https://127.0.0.1:8080/file.tar.gz" ,
131114 .scheme = " http" ,
132115 .authority = " 127.0.0.1:8080" ,
@@ -143,7 +126,6 @@ namespace nix {
143126 auto parsed = parseURL (s);
144127
145128 ParsedURL expected {
146- .url = " http://[fe80::818c:da4d:8975:415c\%enp0s25]:8080" ,
147129 .base = " http://[fe80::818c:da4d:8975:415c\%enp0s25]:8080" ,
148130 .scheme = " http" ,
149131 .authority = " [fe80::818c:da4d:8975:415c\%enp0s25]:8080" ,
@@ -161,7 +143,6 @@ namespace nix {
161143 auto parsed = parseURL (s);
162144
163145 ParsedURL expected {
164- .url = " http://[2a02:8071:8192:c100:311d:192d:81ac:11ea]:8080" ,
165146 .base = " http://[2a02:8071:8192:c100:311d:192d:81ac:11ea]:8080" ,
166147 .scheme = " http" ,
167148 .authority = " [2a02:8071:8192:c100:311d:192d:81ac:11ea]:8080" ,
@@ -185,7 +166,6 @@ namespace nix {
185166 auto parsed = parseURL (s);
186167
187168 ParsedURL expected {
188- .
url =
" http://user:[email protected] /file.tar.gz" ,
189169 .
base =
" http://user:[email protected] /file.tar.gz" ,
190170 .scheme = " http" ,
191171 .
authority =
" user:[email protected] :8080" ,
@@ -203,7 +183,6 @@ namespace nix {
203183 auto parsed = parseURL (s);
204184
205185 ParsedURL expected {
206- .url = " " ,
207186 .base = " " ,
208187 .scheme = " file" ,
209188 .authority = " " ,
@@ -228,7 +207,6 @@ namespace nix {
228207 auto parsed = parseURL (s);
229208
230209 ParsedURL expected {
231- .url = " ftp://ftp.nixos.org/downloads/nixos.iso" ,
232210 .base = " ftp://ftp.nixos.org/downloads/nixos.iso" ,
233211 .scheme = " ftp" ,
234212 .authority = " ftp.nixos.org" ,
0 commit comments