summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPhil Booth <pmbooth@gmail.com>2018-09-26 06:49:21 +0100
committerPhil Booth <pmbooth@gmail.com>2018-09-26 07:02:39 +0100
commita1cd868c0224f16d921a25f04cbc39cb03a5471d (patch)
tree41159d19af67c8bacc1917b0ddac193a8e6bf416 /tests
parent4475925dc2136ae139245164cbb77d59b3d84dae (diff)
Treat empty environment variables as unset
Diffstat (limited to 'tests')
-rw-r--r--tests/env.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/env.rs b/tests/env.rs
index 932d2fc..d1cb11a 100644
--- a/tests/env.rs
+++ b/tests/env.rs
@@ -60,3 +60,15 @@ fn test_separator_behavior() {
env::remove_var("C_B_A");
}
+
+#[test]
+#[cfg(feature = "ignore-empty-env-vars")]
+fn test_empty_value_is_ignored() {
+ env::set_var("C_A_B", "");
+
+ let environment = Environment::new();
+
+ assert!(!environment.collect().unwrap().contains_key("c_a_b"));
+
+ env::remove_var("C_A_B");
+}