提交 357b41bf 编写于 作者: M Manish Goregaokar

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

上级 d54ed567
......@@ -927,7 +927,7 @@ fn test() {
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")));
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册