Simon Sapin 9 лет назад
Родитель
Сommit
42921c8104
1 измененных файлов с 11 добавлено и 0 удалено
  1. 11 0
      tests/unit.rs

+ 11 - 0
tests/unit.rs

@@ -15,6 +15,12 @@ use std::net::{Ipv4Addr, Ipv6Addr};
 use std::path::{Path, PathBuf};
 use url::{Host, Url, form_urlencoded};
 
+#[test]
+fn size() {
+    use std::mem::size_of;
+    assert_eq!(size_of::<Url>(), size_of::<Option<Url>>());
+}
+
 macro_rules! assert_from_file_path {
     ($path: expr) => { assert_from_file_path!($path, $path) };
     ($path: expr, $url_path: expr) => {{
@@ -274,6 +280,11 @@ fn issue_197() {
     url.path_segments_mut().expect("path_segments_mut").pop_if_empty();
 }
 
+#[test]
+fn issue_241() {
+    Url::parse("mailto:").unwrap().cannot_be_a_base();
+}
+
 #[test]
 /// https://github.com/servo/rust-url/issues/222
 fn append_trailing_slash() {