summaryrefslogtreecommitdiffstats
path: root/tests/env.rs
diff options
context:
space:
mode:
authorConrad Ludgate <conrad.ludgate@truelayer.com>2022-02-24 09:28:03 +0000
committerConrad Ludgate <conrad.ludgate@truelayer.com>2022-02-24 10:20:46 +0000
commite8985eacc7de0fb1916ab20a7bb40b9851c0f7da (patch)
tree56170583fcf6c912f5f6a9ef5a04ba02861ee782 /tests/env.rs
parent30d87a311929f5382cb4ecd1de62f20d2dddfb86 (diff)
add prefix separator support
Diffstat (limited to 'tests/env.rs')
-rw-r--r--tests/env.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/env.rs b/tests/env.rs
index edd8dff..90852e0 100644
--- a/tests/env.rs
+++ b/tests/env.rs
@@ -86,6 +86,19 @@ fn test_custom_separator_behavior() {
}
#[test]
+fn test_custom_prefix_separator_behavior() {
+ env::set_var("C-B.A", "abc");
+
+ let environment = Environment::with_prefix("C")
+ .separator(".")
+ .prefix_separator("-");
+
+ assert!(environment.collect().unwrap().contains_key("b.a"));
+
+ env::remove_var("C-B.A");
+}
+
+#[test]
fn test_parse_int() {
// using a struct in an enum here to make serde use `deserialize_any`
#[derive(Deserialize, Debug)]