about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMarco A L Barbosa <malbarbo@gmail.com>2018-01-24 15:11:15 -0200
committerMarco A L Barbosa <malbarbo@gmail.com>2018-01-29 15:40:27 -0200
commit898fdcc3eda5c5fa32e893b27f066d2dad77ea77 (patch)
treea5a744718efee30f90a854a0da19570f9e4c1c61 /src
parent4e3901d35f6a8652f67111e7272263c9e62ab3e1 (diff)
downloadrust-898fdcc3eda5c5fa32e893b27f066d2dad77ea77.tar.gz
rust-898fdcc3eda5c5fa32e893b27f066d2dad77ea77.zip
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).
Diffstat (limited to 'src')
-rw-r--r--src/test/run-pass/env-home-dir.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test/run-pass/env-home-dir.rs b/src/test/run-pass/env-home-dir.rs
index 22e440c6ffa..449d3b044e9 100644
--- a/src/test/run-pass/env-home-dir.rs
+++ b/src/test/run-pass/env-home-dir.rs
@@ -16,6 +16,9 @@
 use std::env::*;
 use std::path::PathBuf;
 
+/// When HOME is not set, some platforms return `None`, but others return `Some` with a default.
+/// Just check that it is not "/home/MountainView".
+
 #[cfg(unix)]
 fn main() {
     let oldhome = var("HOME");
@@ -27,7 +30,7 @@ fn main() {
     if cfg!(target_os = "android") {
         assert!(home_dir().is_none());
     } else {
-        assert!(home_dir().is_some());
+        assert_ne!(home_dir(), Some(PathBuf::from("/home/MountainView")));
     }
 }