提交 fccc85a0 编写于 作者: K kennytm 提交者: GitHub

Rollup merge of #47718 - malbarbo:env-home-dir, r=nikomatsakis

Make run-pass/env-home-dir.rs test more robust

Remove the assumption that home_dir always returns Some.

This allows the test to be executed with [cross](https://github.com/japaric/cross).
......@@ -27,7 +27,10 @@ fn main() {
if cfg!(target_os = "android") {
assert!(home_dir().is_none());
} else {
assert!(home_dir().is_some());
// When HOME is not set, some platforms return `None`,
// but others return `Some` with a default.
// Just check that it is not "/home/MountainView".
assert_ne!(home_dir(), Some(PathBuf::from("/home/MountainView")));
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册