Skip to content

Fix tests for nightly #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ fn parse_test_data(input: &str) -> Vec<Test> {
continue
}
let colon = piece.find(':').unwrap();
let value = unescape(piece.slice_from(colon + 1));
match piece.slice_to(colon) {
let value = unescape(&piece[colon + 1..]);
match &piece[..colon] {
"s" => test.scheme = Some(value),
"u" => test.username = value,
"pass" => test.password = Some(value),
Expand Down Expand Up @@ -207,7 +207,7 @@ fn file_paths() {
assert_eq!(Url::from_file_path(&path::windows::Path::new(r"\drive-relative")), Err(()));
assert_eq!(Url::from_file_path(&path::windows::Path::new(r"\\ucn\")), Err(()));

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")).ok().unwrap();
assert_eq!(url.host(), Some(&Host::Domain("".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")));
Expand All @@ -223,7 +223,7 @@ fn file_paths() {
assert!(url.to_file_path() == Ok(path::posix::Path::new(
/* note: byte string, invalid UTF-8 */ b"/foo/ba\x80r")));

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")).ok().unwrap();
assert_eq!(url.host(), Some(&Host::Domain("".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>()
Expand All @@ -250,11 +250,11 @@ fn directory_paths() {
assert_eq!(Url::from_directory_path(&path::windows::Path::new(r"\drive-relative")), Err(()));
assert_eq!(Url::from_directory_path(&path::windows::Path::new(r"\\ucn\")), Err(()));

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")).ok().unwrap();
assert_eq!(url.host(), Some(&Host::Domain("".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();
let url = Url::from_directory_path(&path::windows::Path::new(r"C:\foo\bar")).ok().unwrap();
assert_eq!(url.host(), Some(&Host::Domain("".to_string())));
assert_eq!(url.path(), Some([
"C:".to_string(), "foo".to_string(), "bar".to_string(), "".to_string()].as_slice()));
Expand Down