diff options
author | Christian Fochler <mail@christianfochler.de> | 2018-02-13 10:04:55 +0100 |
---|---|---|
committer | Christian Fochler <mail@christianfochler.de> | 2018-02-13 10:04:55 +0100 |
commit | 2fe18bbe8716402f6c56101ccbd55f5f1879d884 (patch) | |
tree | c34ac84faafc94d855cff70267d9481fa6e8b53b /tests/env.rs | |
parent | 05f02ebc1c480fc4d00ac6e637806fd30a42db20 (diff) |
add test for prefix with variant forms of spelling
Diffstat (limited to 'tests/env.rs')
-rw-r--r-- | tests/env.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/env.rs b/tests/env.rs index 2a55d7f..b204118 100644 --- a/tests/env.rs +++ b/tests/env.rs @@ -26,6 +26,31 @@ fn test_prefix_is_removed_from_key() { } #[test] +fn test_prefix_with_variant_forms_of_spelling() { + env::set_var("a_A_C", "abc"); + + let environment = Environment::with_prefix("a"); + + assert!(environment.collect().unwrap().contains_key("a_c")); + + env::remove_var("a_A_C"); + env::set_var("aB_A_C", "abc"); + + let environment = Environment::with_prefix("aB"); + + assert!(environment.collect().unwrap().contains_key("a_c")); + + env::remove_var("aB_A_C"); + env::set_var("Ab_A_C", "abc"); + + let environment = Environment::with_prefix("ab"); + + assert!(environment.collect().unwrap().contains_key("a_c")); + + env::remove_var("Ab_A_C"); +} + +#[test] fn test_separator_behavior() { env::set_var("C_B_A", "abc"); |