Skip to content

Commit

Permalink
Fix tests to build with current rust
Browse files Browse the repository at this point in the history
  • Loading branch information
dotdash committed Aug 26, 2014
1 parent 965590b commit 4de939b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ let issue_list_url = Url::parse(
assert!(issue_list_url.scheme == "https".to_string());
assert!(issue_list_url.domain() == Some("github.com"));
assert!(issue_list_url.port() == None);
assert!(issue_list_url.path() == Some(&["rust-lang".to_string(),
assert!(issue_list_url.path() == Some(["rust-lang".to_string(),
"rust".to_string(),
"issues".to_string()]));
"issues".to_string()].as_slice()));
assert!(issue_list_url.query == Some("labels=E-easy&state=open".to_string()));
assert!(issue_list_url.fragment == None);
match issue_list_url.scheme_data {
Expand Down
10 changes: 5 additions & 5 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ fn file_paths() {

let mut url = Url::from_file_path(&path::posix::Path::new("/foo/bar")).unwrap();
assert_eq!(url.host(), Some(&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()].as_slice()));
assert!(url.to_file_path() == Ok(path::posix::Path::new("/foo/bar")));

*url.path_mut().unwrap().get_mut(1) = "ba\0r".to_string();
Expand All @@ -226,7 +226,7 @@ fn file_paths() {

let mut url = Url::from_file_path(&path::windows::Path::new(r"C:\foo\bar")).unwrap();
assert_eq!(url.host(), Some(&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()].as_slice()));
assert!(url.to_file_path::<path::windows::Path>()
== Ok(path::windows::Path::new(r"C:\foo\bar")));

Expand All @@ -253,10 +253,10 @@ fn directory_paths() {

let url = Url::from_directory_path(&path::posix::Path::new("/foo/bar")).unwrap();
assert_eq!(url.host(), Some(&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()].as_slice()));

let url = Url::from_directory_path(&path::windows::Path::new(r"C:\foo\bar")).unwrap();
assert_eq!(url.host(), Some(&Domain("".to_string())));
assert_eq!(url.path(), Some(&[
"C:".to_string(), "foo".to_string(), "bar".to_string(), "".to_string()]));
assert_eq!(url.path(), Some([
"C:".to_string(), "foo".to_string(), "bar".to_string(), "".to_string()].as_slice()));
}

0 comments on commit 4de939b

Please sign in to comment.