| Index: src/net/url/url_test.go |
| =================================================================== |
| --- a/src/net/url/url_test.go |
| +++ b/src/net/url/url_test.go |
| @@ -112,6 +112,39 @@ |
| }, |
| "http:www.google.com/?q=go+language", |
| }, |
| + // path with extra leading ///, expected formatting |
| + { |
| + "http:///www.google.com/?q=go+language", |
| + &URL{ |
| + Scheme: "http", |
| + Path: "/", |
| + Opaque: "", |
| + Host: "www.google.com", |
| + RawQuery: "q=go+language", |
| + }, |
| + "http://www.google.com/?q=go+language", |
| + }, |
| + |
| + // ssh checks |
| + { |
| + "ssh://///gobot:foo@github.com/go.git", |
| + &URL{ |
| + Scheme: "ssh", |
| + User: UserPassword("gobot", "foo"), |
| + Host: "github.com", |
| + Path: "/go.git", |
| + }, |
| + "ssh://gobot:foo@github.com/go.git", |
| + }, |
| + { |
| + "http:/localhost:9999/a", |
| + &URL{ |
| + Scheme: "http", |
| + Host: "localhost:9999", |
| + Path: "/a", |
| + }, |
| + "http://localhost:9999/a", |
| + }, |
| // path without leading /, so no parsing |
| { |
| "http:%2f%2fwww.google.com/?q=go+language", |
| @@ -127,9 +160,9 @@ |
| "mailto:/webmaster@golang.org", |
| &URL{ |
| Scheme: "mailto", |
| - Path: "/webmaster@golang.org", |
| + Opaque: "webmaster@golang.org", |
| }, |
| - "mailto:///webmaster@golang.org", // unfortunate compromise |
| + "mailto:webmaster@golang.org", |
| }, |
| // non-authority |
| { |