Skip to content

Commit

Permalink
Rollup merge of rust-lang#47718 - malbarbo:env-home-dir, r=nikomatsakis
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
kennytm authored Jan 30, 2018
2 parents 3e39180 + adeb0ae commit fccc85a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/test/run-pass/env-home-dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
}
}

Expand Down

0 comments on commit fccc85a

Please sign in to comment.