• Home
  • Raw
  • Download

Lines Matching refs:Url

15 use url::{form_urlencoded, Host, Origin, Url};
20 assert_eq!(size_of::<Url>(), size_of::<Option<Url>>()); in size()
25 let base: Url = "sc://%C3%B1".parse().unwrap(); in test_relative()
32 let base: Url = "sc://%C3%B1".parse().unwrap(); in test_relative_empty()
39 let mut base: Url = "moz://foo:bar@servo/baz".parse().unwrap(); in test_set_empty_host()
51 let mut base: Url = "moz://foo@servo/baz".parse().unwrap(); in test_set_empty_hostname()
71 let url = Url::from_file_path(Path::new($path)).unwrap();
81 assert_eq!(Url::from_file_path(Path::new("relative")), Err(())); in new_file_paths()
82 assert_eq!(Url::from_file_path(Path::new("../relative")), Err(())); in new_file_paths()
85 assert_eq!(Url::from_file_path(Path::new("relative")), Err(())); in new_file_paths()
86 assert_eq!(Url::from_file_path(Path::new(r"..\relative")), Err(())); in new_file_paths()
87 assert_eq!(Url::from_file_path(Path::new(r"\drive-relative")), Err(())); in new_file_paths()
88 assert_eq!(Url::from_file_path(Path::new(r"\\ucn\")), Err(())); in new_file_paths()
104 let url = Url::from_file_path(Path::new(OsStr::from_bytes(b"/foo/ba\x80r"))).unwrap(); in new_path_bad_utf8()
116 assert!(Url::parse("file:///C:/foo/ba%80r") in new_path_windows_fun()
123 assert!(Url::from_file_path(path).is_ok()); in new_path_windows_fun()
126 let url = Url::parse("file:///C%3A/foo/bar").unwrap(); in new_path_windows_fun()
134 assert_eq!(Url::from_directory_path(Path::new("relative")), Err(())); in new_directory_paths()
135 assert_eq!(Url::from_directory_path(Path::new("../relative")), Err(())); in new_directory_paths()
137 let url = Url::from_directory_path(Path::new("/foo/bar")).unwrap(); in new_directory_paths()
142 assert_eq!(Url::from_directory_path(Path::new("relative")), Err(())); in new_directory_paths()
143 assert_eq!(Url::from_directory_path(Path::new(r"..\relative")), Err(())); in new_directory_paths()
145 Url::from_directory_path(Path::new(r"\drive-relative")), in new_directory_paths()
148 assert_eq!(Url::from_directory_path(Path::new(r"\\ucn\")), Err(())); in new_directory_paths()
150 let url = Url::from_directory_path(Path::new(r"C:\foo\bar")).unwrap(); in new_directory_paths()
158 let mut special_url = "http://foobar.com".parse::<Url>().unwrap(); in path_backslash_fun()
162 let mut nonspecial_url = "thing://foobar.com".parse::<Url>().unwrap(); in path_backslash_fun()
169 assert!("http://testing.com/this".parse::<Url>().is_ok()); in from_str()
174 let url = Url::parse_with_params( in parse_with_params()
188 let url: Url = "file:a".parse().unwrap(); in issue_124()
190 let url: Url = "file:...".parse().unwrap(); in issue_124()
192 let url: Url = "file:..".parse().unwrap(); in issue_124()
201 fn check_eq(a: &Url, b: &Url) { in test_equality() argument
211 fn url(s: &str) -> Url { in test_equality() argument
218 let a: Url = url("https://example.com/"); in test_equality()
219 let b: Url = url("https://example.com:443/"); in test_equality()
223 let a: Url = url("http://example.com/"); in test_equality()
224 let b: Url = url("http://example.com:8080/"); in test_equality()
228 let a: Url = url("http://example.com/"); in test_equality()
229 let b: Url = url("https://example.com/"); in test_equality()
233 let a: Url = url("http://foo.com/"); in test_equality()
234 let b: Url = url("http://bar.com/"); in test_equality()
238 let a: Url = url("http://foo.com"); in test_equality()
239 let b: Url = url("http://foo.com/"); in test_equality()
246 assert_eq!(Url::parse(input).unwrap().host(), Some(host)); in host()
275 assert!(Url::parse("http://42.0x1232131").is_err()); in host()
276 assert!(Url::parse("http://192.168.0.257").is_err()); in host()
290 Url::parse("http://[0::2]").unwrap().host_str(), in host_serialization()
294 Url::parse("http://[0::ffff:0:2]").unwrap().host_str(), in host_serialization()
301 assert!("http://goșu.ro".parse::<Url>().is_ok()); in test_idna()
303 Url::parse("http://☃.net/").unwrap().host(), in test_idna()
307 .parse::<Url>() in test_idna()
333 let url = Url::parse(input).unwrap(); in test_serialization()
379 let mut url = Url::parse("http://mozilla.org").unwrap(); in issue_61()
390 let mut url = Url::from_file_path("/").expect("Failed to parse path"); in issue_197()
394 Url::parse("file:///").expect("Failed to parse path + protocol") in issue_197()
403 Url::parse("mailto:").unwrap().cannot_be_a_base(); in issue_241()
409 let mut url: Url = "http://localhost:6767/foo/bar?a=b".parse().unwrap(); in append_trailing_slash()
419 let mut url: Url = "http://localhost:6767/foo/bar".parse().unwrap(); in extend_query_pairs_then_mutate()
438 let mut url: Url = "http://localhost:6767/foo/bar?a=b".parse().unwrap(); in append_empty_segment_then_mutate()
448 let mut url = Url::parse("https://example.net/hello").unwrap(); in test_set_host()
456 let mut url = Url::parse("foobar://example.net/hello").unwrap(); in test_set_host()
460 let mut url = Url::parse("foo://ș").unwrap(); in test_set_host()
473 assert_eq!(Url::parse("file://./foo").unwrap().domain(), Some(".")); in test_leading_dots()
488 let origin = &Url::parse("http://example.net/").unwrap().origin(); in test_origin_hash()
491 Url::parse("http://example.net:80/").unwrap().origin(), in test_origin_hash()
492 Url::parse("http://example.net:81/").unwrap().origin(), in test_origin_hash()
493 Url::parse("http://example.net").unwrap().origin(), in test_origin_hash()
494 Url::parse("http://example.net/hello").unwrap().origin(), in test_origin_hash()
495 Url::parse("https://example.net").unwrap().origin(), in test_origin_hash()
496 Url::parse("ftp://example.net").unwrap().origin(), in test_origin_hash()
497 Url::parse("file://example.net").unwrap().origin(), in test_origin_hash()
498 Url::parse("http://user@example.net/").unwrap().origin(), in test_origin_hash()
499 Url::parse("http://user:pass@example.net/") in test_origin_hash()
512 let opaque_origin = Url::parse("file://example.net").unwrap().origin(); in test_origin_hash()
513 let same_opaque_origin = Url::parse("file://example.net").unwrap().origin(); in test_origin_hash()
514 let other_opaque_origin = Url::parse("file://other").unwrap().origin(); in test_origin_hash()
522 let origin = &Url::parse("http://example.net/").unwrap().origin(); in test_origin_blob_equality()
523 let blob_origin = &Url::parse("blob:http://example.net/").unwrap().origin(); in test_origin_blob_equality()
531 assert!(!&Url::parse("blob:malformed//").unwrap().origin().is_tuple()) in test_origin_opaque()
543 let origin = Url::parse(unicode_url).unwrap().origin(); in test_origin_unicode_serialization()
548 Url::parse("http://example.net/").unwrap().origin(), in test_origin_unicode_serialization()
549 Url::parse("http://example.net:80/").unwrap().origin(), in test_origin_unicode_serialization()
550 Url::parse("http://example.net:81/").unwrap().origin(), in test_origin_unicode_serialization()
551 Url::parse("http://example.net").unwrap().origin(), in test_origin_unicode_serialization()
552 Url::parse("http://example.net/hello").unwrap().origin(), in test_origin_unicode_serialization()
553 Url::parse("https://example.net").unwrap().origin(), in test_origin_unicode_serialization()
554 Url::parse("ftp://example.net").unwrap().origin(), in test_origin_unicode_serialization()
555 Url::parse("file://example.net").unwrap().origin(), in test_origin_unicode_serialization()
556 Url::parse("http://user@example.net/").unwrap().origin(), in test_origin_unicode_serialization()
557 Url::parse("http://user:pass@example.net/") in test_origin_unicode_serialization()
560 Url::parse("http://127.0.0.1").unwrap().origin(), in test_origin_unicode_serialization()
590 let url = url::Url::parse(url_string).unwrap(); in test_socket_addrs()
606 let mut no_base_url = Url::parse("mailto:test@example.net").unwrap(); in test_no_base_url()
622 let url = Url::parse("https://127.0.0.1/").unwrap(); in test_domain()
625 let url = Url::parse("mailto:test@example.net").unwrap(); in test_domain()
628 let url = Url::parse("https://example.com/").unwrap(); in test_domain()
634 let url = Url::parse("https://example.com/products?page=2#fragment").unwrap(); in test_query()
641 let url = Url::parse("https://example.com/products").unwrap(); in test_query()
645 let url = Url::parse("https://example.com/?country=español").unwrap(); in test_query()
652 let url = Url::parse("https://example.com/products?page=2&sort=desc").unwrap(); in test_query()
668 let url = Url::parse("https://example.com/#fragment").unwrap(); in test_fragment()
671 let url = Url::parse("https://example.com/").unwrap(); in test_fragment()
677 let mut url = Url::parse("http://example.com").unwrap(); in test_set_ip_host()
690 let mut url = Url::parse("https://existing.url").unwrap(); in test_set_href()
701 Url::parse("https://user:pass@domain.com:9742/path/file.ext?key=val&key2=val2#fragment") in test_set_href()
729 let url = Url::from_file_path(Path::new(r"\\host\share\path\file.txt")).unwrap(); in test_windows_unc_path()
732 let url = Url::from_file_path(Path::new(r"\\höst\share\path\file.txt")).unwrap(); in test_windows_unc_path()
735 let url = Url::from_file_path(Path::new(r"\\192.168.0.1\share\path\file.txt")).unwrap(); in test_windows_unc_path()
742 let url = Url::from_file_path(Path::new(r"\\?\UNC\host\share\path\file.txt")).unwrap(); in test_windows_unc_path()
746 let url = Url::from_file_path(Path::new(r"\\.\some\path\file.txt")); in test_windows_unc_path()
754 let url = Url::options() in test_syntax_violation_callback()
772 let url = Url::options() in test_syntax_violation_callback_lifetimes()
779 let url = Url::options() in test_syntax_violation_callback_lifetimes()
807 Url::options() in test_syntax_violation_callback_types()
825 let options = Url::options().syntax_violation_callback(Some(&vfn)); in test_options_reuse()
839 use url::Url; in test_url_from_file_path()
842 let u = Url::from_file_path(p).unwrap(); in test_url_from_file_path()
852 use url::Url;
855 let u = Url::from_file_path(p).unwrap();
862 let mut db_url = url::Url::parse("postgres://postgres@localhost/").unwrap();
871 let mut db_url = url::Url::parse("postgres://postgres@localhost/").unwrap();
886 let mut db_url = url::Url::parse("postgres://postgres@localhost/").unwrap();
898 let mut url: Url = "http://localhost:6767/foo/bar".parse().unwrap();
906 let mut url = Url::parse("arhttpsps:/.//eom/dae.com/\\\\t\\:").unwrap();
912 let mut url = Url::parse("m://").unwrap();
973 let url = Url::parse(expected_slices.full).unwrap();
1087 let base_uri = url::Url::parse(base).unwrap();
1088 let relative_uri = url::Url::parse(uri).unwrap();
1113 let base_uri = url::Url::parse(base).unwrap();
1114 let relative_uri = url::Url::parse(uri).unwrap();