Path -> PathBuf for Windows test (fixup #22727)
This commit is contained in:
parent
d54ed567e0
commit
357b41bfcf
2 changed files with 4 additions and 4 deletions
|
@ -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 [""]));
|
||||
|
|
|
@ -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")));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue