|
@@ -209,7 +209,7 @@ fn file_paths() {
|
|
|
|
|
|
|
|
let mut url = Url::from_file_path(&path::posix::Path::new("/foo/bar")).unwrap();
|
|
let mut url = Url::from_file_path(&path::posix::Path::new("/foo/bar")).unwrap();
|
|
|
assert_eq!(url.host(), Some(&Host::Domain("".to_string())));
|
|
assert_eq!(url.host(), Some(&Host::Domain("".to_string())));
|
|
|
- assert_eq!(url.path(), Some(&["foo".to_string(), "bar".to_string()][]));
|
|
|
|
|
|
|
+ assert_eq!(url.path(), Some(&["foo".to_string(), "bar".to_string()][..]));
|
|
|
assert!(url.to_file_path() == Ok(path::posix::Path::new("/foo/bar")));
|
|
assert!(url.to_file_path() == Ok(path::posix::Path::new("/foo/bar")));
|
|
|
|
|
|
|
|
url.path_mut().unwrap()[1] = "ba\0r".to_string();
|
|
url.path_mut().unwrap()[1] = "ba\0r".to_string();
|
|
@@ -225,7 +225,7 @@ fn file_paths() {
|
|
|
|
|
|
|
|
let mut url = Url::from_file_path(&path::windows::Path::new(r"C:\foo\bar")).unwrap();
|
|
let mut url = Url::from_file_path(&path::windows::Path::new(r"C:\foo\bar")).unwrap();
|
|
|
assert_eq!(url.host(), Some(&Host::Domain("".to_string())));
|
|
assert_eq!(url.host(), Some(&Host::Domain("".to_string())));
|
|
|
- assert_eq!(url.path(), Some(&["C:".to_string(), "foo".to_string(), "bar".to_string()][]));
|
|
|
|
|
|
|
+ assert_eq!(url.path(), Some(&["C:".to_string(), "foo".to_string(), "bar".to_string()][..]));
|
|
|
assert!(url.to_file_path::<path::windows::Path>()
|
|
assert!(url.to_file_path::<path::windows::Path>()
|
|
|
== Ok(path::windows::Path::new(r"C:\foo\bar")));
|
|
== Ok(path::windows::Path::new(r"C:\foo\bar")));
|
|
|
|
|
|
|
@@ -252,10 +252,10 @@ fn directory_paths() {
|
|
|
|
|
|
|
|
let url = Url::from_directory_path(&path::posix::Path::new("/foo/bar")).unwrap();
|
|
let url = Url::from_directory_path(&path::posix::Path::new("/foo/bar")).unwrap();
|
|
|
assert_eq!(url.host(), Some(&Host::Domain("".to_string())));
|
|
assert_eq!(url.host(), Some(&Host::Domain("".to_string())));
|
|
|
- assert_eq!(url.path(), Some(&["foo".to_string(), "bar".to_string(), "".to_string()][]));
|
|
|
|
|
|
|
+ assert_eq!(url.path(), Some(&["foo".to_string(), "bar".to_string(), "".to_string()][..]));
|
|
|
|
|
|
|
|
let url = Url::from_directory_path(&path::windows::Path::new(r"C:\foo\bar")).unwrap();
|
|
let url = Url::from_directory_path(&path::windows::Path::new(r"C:\foo\bar")).unwrap();
|
|
|
assert_eq!(url.host(), Some(&Host::Domain("".to_string())));
|
|
assert_eq!(url.host(), Some(&Host::Domain("".to_string())));
|
|
|
assert_eq!(url.path(), Some(&[
|
|
assert_eq!(url.path(), Some(&[
|
|
|
- "C:".to_string(), "foo".to_string(), "bar".to_string(), "".to_string()][]));
|
|
|
|
|
|
|
+ "C:".to_string(), "foo".to_string(), "bar".to_string(), "".to_string()][..]));
|
|
|
}
|
|
}
|