Path -> PathBuf for Windows test (fixup #22727)

This commit is contained in:
Manish Goregaokar 2015-02-25 18:09:53 +05:30
parent d54ed567e0
commit 357b41bfcf
2 changed files with 4 additions and 4 deletions

View file

@ -927,7 +927,7 @@ mod tests {
fn split_paths_windows() {
fn check_parse(unparsed: &str, parsed: &[&str]) -> bool {
split_paths(unparsed).collect::<Vec<_>>() ==
parsed.iter().map(|s| Path::new(*s)).collect::<Vec<_>>()
parsed.iter().map(|s| PathBuf::new(*s)).collect::<Vec<_>>()
}
assert!(check_parse("", &mut [""]));

View file

@ -37,14 +37,14 @@ fn main() {
assert!(home_dir().is_some());
set_var("HOME", "/home/MountainView");
assert!(home_dir() == Some(Path::new("/home/MountainView")));
assert!(home_dir() == Some(PathBuf::new("/home/MountainView")));
remove_var("HOME");
set_var("USERPROFILE", "/home/MountainView");
assert!(home_dir() == Some(Path::new("/home/MountainView")));
assert!(home_dir() == Some(PathBuf::new("/home/MountainView")));
set_var("HOME", "/home/MountainView");
set_var("USERPROFILE", "/home/PaloAlto");
assert!(home_dir() == Some(Path::new("/home/MountainView")));
assert!(home_dir() == Some(PathBuf::new("/home/MountainView")));
}