Skip to content

Commit ce65168

Browse files
author
1911860538
committed
net/url: revert deleted unit test cases
1 parent 8165599 commit ce65168

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/net/url/url_test.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,37 @@ var urltests = []URLTest{
231231
},
232232
"http://user:password@google.com",
233233
},
234+
// unescaped @ in username should not confuse host
235+
{
236+
"http://j@ne:password@google.com",
237+
&URL{
238+
Scheme: "http",
239+
User: UserPassword("j@ne", "password"),
240+
Host: "google.com",
241+
},
242+
"http://j%40ne:password@google.com",
243+
},
244+
// unescaped @ in password should not confuse host
245+
{
246+
"http://jane:p@ssword@google.com",
247+
&URL{
248+
Scheme: "http",
249+
User: UserPassword("jane", "p@ssword"),
250+
Host: "google.com",
251+
},
252+
"http://jane:p%40ssword@google.com",
253+
},
254+
{
255+
"http://j@ne:password@google.com/p@th?q=@go",
256+
&URL{
257+
Scheme: "http",
258+
User: UserPassword("j@ne", "password"),
259+
Host: "google.com",
260+
Path: "/p@th",
261+
RawQuery: "q=@go",
262+
},
263+
"http://j%40ne:password@google.com/p@th?q=@go",
264+
},
234265
{
235266
"http://www.google.com/?q=go+language#foo",
236267
&URL{

0 commit comments

Comments
 (0)