diff options
author | Joel Gallant <joel@joelgallant.me> | 2020-05-01 13:25:47 -0600 |
---|---|---|
committer | John Brandt <johnb0@outlook.com> | 2021-05-04 10:30:31 -0600 |
commit | a5c3fab7c79fae06512ead0c0c05c354000b0ce8 (patch) | |
tree | 3316ee0c16a000f641cf6b6aa425807b81d6cb92 /tests | |
parent | a6088847f06e99e3d15148c4cec9b7f5c469bf9b (diff) |
Uses into_* for value conversions and adds bool as an option
Diffstat (limited to 'tests')
-rw-r--r-- | tests/env.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/env.rs b/tests/env.rs index fdeb373..8ab5be0 100644 --- a/tests/env.rs +++ b/tests/env.rs @@ -87,6 +87,7 @@ fn test_custom_separator_behavior() { fn test_parse_numbers() { env::set_var("INT_VAL", "42"); env::set_var("FLOAT_VAL", "42.2"); + env::set_var("BOOL_VAL", "true"); let environment = Environment::new().parse_numbers(true); let values = environment.collect().unwrap(); @@ -99,7 +100,12 @@ fn test_parse_numbers() { values.get("float_val").unwrap().clone().into_float().ok(), Some(42.2) ); + assert_eq!( + values.get("bool_val").unwrap().clone().into_bool().ok(), + Some(true) + ); env::remove_var("INT_VAL"); env::remove_var("FLOAT_VAL"); + env::remove_var("BOOL_VAL"); } |