Lines Matching refs:URL
5 package url
22 out *URL // expected parse; RawPath="" means same as Path
23 roundtrip string // expected result of reserializing the URL; empty means same as "in".
30 &URL{
39 &URL{
49 &URL{
60 &URL{
71 &URL{
82 &URL{
93 &URL{
104 &URL{
115 &URL{
126 &URL{
137 &URL{
147 &URL{
157 &URL{
166 &URL{
175 &URL{
184 &URL{
192 &URL{
203 // different URL parsing context, but currently shares the
207 &URL{
214 &URL{
224 &URL{
234 &URL{
243 &URL{
254 &URL{
265 &URL{
276 &URL{
287 &URL{
297 &URL{
306 &URL{
314 &URL{
324 &URL{
334 &URL{
344 &URL{
354 &URL{
364 &URL{
374 &URL{
384 &URL{
394 &URL{
404 &URL{
416 &URL{
426 &URL{
436 &URL{
447 &URL{
458 &URL{
467 &URL{
477 &URL{
487 &URL{
496 &URL{
505 &URL{
515 &URL{
524 &URL{
533 &URL{
543 &URL{
553 &URL{
565 &URL{
571 // test we can roundtrip magnet url
575 &URL{
585 &URL{
596 func ufmt(u *URL) string {
648 url string
688 _, err := ParseRequestURI(test.url)
690 t.Errorf("ParseRequestURI(%q) gave err %v; want no error", test.url, err)
692 t.Errorf("ParseRequestURI(%q) gave nil error; want some error", test.url)
696 url, err := ParseRequestURI(pathThatLooksSchemeRelative)
700 if url.Path != pathThatLooksSchemeRelative {
701 t.Errorf("ParseRequestURI path:\ngot %q\nwant %q", url.Path, pathThatLooksSchemeRelative)
706 url URL
711 url: URL{
720 url: URL{
727 url: URL{
734 url: URL{
761 if got := tt.url.String(); got != tt.want {
762 t.Errorf("%+v.String() = %q; want %q", tt.url, got, tt.want)
1023 // Absolute URL references
1144 mustParse := func(url string) *URL {
1145 u, err := Parse(url)
1147 t.Fatalf("Parse(%q) got err %v", url, err)
1151 opaque := &URL{Scheme: "scheme", Opaque: "opaque"}
1155 url := base.ResolveReference(rel)
1156 if got := url.String(); got != test.expected {
1157 t.Errorf("URL(%q).ResolveReference(%q)\ngot %q\nwant %q", test.base, test.rel, got, test.expected)
1160 if base == url {
1161 t.Errorf("Expected URL.ResolveReference to return new URL instance.")
1164 url, err := base.Parse(test.rel)
1166 t.Errorf("URL(%q).Parse(%q) failed: %v", test.base, test.rel, err)
1167 } else if got := url.String(); got != test.expected {
1168 t.Errorf("URL(%q).Parse(%q)\ngot %q\nwant %q", test.base, test.rel, got, test.expected)
1169 } else if base == url {
1171 t.Errorf("Expected URL.Parse to return new URL instance.")
1173 // Ensure Opaque resets the URL.
1174 url = base.ResolveReference(opaque)
1175 if *url != *opaque {
1176 t.Errorf("ResolveReference failed to resolve opaque URL:\ngot %#v\nwant %#v", url, opaque)
1178 // Test the convenience wrapper with an opaque URL too.
1179 url, err = base.Parse("scheme:opaque")
1181 t.Errorf(`URL(%q).Parse("scheme:opaque") failed: %v`, test.base, err)
1182 } else if *url != *opaque {
1183 t.Errorf("Parse failed to resolve opaque URL:\ngot %#v\nwant %#v", opaque, url)
1184 } else if base == url {
1186 t.Errorf("Expected URL.Parse to return new URL instance.")
1274 url *URL
1280 &URL{
1288 &URL{
1297 &URL{
1306 &URL{
1315 &URL{
1324 &URL{
1333 &URL{
1342 &URL{
1352 &URL{
1362 &URL{
1369 &URL{
1377 &URL{
1385 &URL{
1397 s := tt.url.RequestURI()
1399 t.Errorf("%#v.RequestURI() == %q (expected %q)", tt.url, s, tt.out)
1406 const url = "%gh&%ij"
1407 _, err := ParseQuery(url)
1410 t.Errorf(`ParseQuery(%q) returned error %q, want something containing %q"`, url, errStr, "%gh")
1600 // Test that url.Error implements net.Error and that it forwards
1620 host string // URL.Host field
1633 u := &URL{Host: tt.host}
1643 host string // URL.Host field
1654 u := &URL{Host: tt.host}
1662 var _ encodingPkg.BinaryMarshaler = (*URL)(nil)
1663 var _ encodingPkg.BinaryUnmarshaler = (*URL)(nil)
1682 u1 := new(URL)
1703 u1 := new(URL)
1741 if got, wantsub := fmt.Sprint(err), "net/url: invalid userinfo"; !strings.Contains(got, wantsub) {