summaryrefslogtreecommitdiffstats
path: root/tests/env.rs
AgeCommit message (Collapse)Author
2023-07-22Make the parse list key to lowercase when insert the keysbigduu
Signed-off-by: bigduu <mugeng.du@qq.com>
2022-09-29env: add a 'convert_case' field to ease dealing with kebab-caseDan Aloni
This allows usage of `kebab-case` attribute in serde, mapping unambiguously into a config value given a multiple character separator. This also add the `convert-case` feature. For example: let environment = Environment::default() .prefix("PREFIX") .translate_key(Case::Kebab) .separator("__");
2022-08-02Fix: Use float_cmp for testing floatsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2022-06-28Use TryInto for more permissive deserialization for integersKesavan Yogeswaran
* Attempt to convert between integer types using `TryInto`-based conversions rather than blanket failing for some source and destination types. * Use `into_uint` instead of `into_int` in `Value` Deserialize implementations for unsigned integer types. Previously, we were converting from signed types to unsigned types using `as`, which can lead to surprise integer values conversions (#93). Fixes #352 and #93
2022-04-18test: Adopt test-env to fix random test failureXuanwo
Signed-off-by: Xuanwo <github@xuanwo.io>
2022-03-11chore: add the possibility to keep the prefix from env var.Jérémy Audiger
2022-02-28feat: env contains list of stringssimon-an
Signed-off-by: simon-an <26556185+simon-an@users.noreply.github.com>
2022-02-24add prefix separator supportConrad Ludgate
2022-01-29use semicolons if nothing returnedDaniel Eades
2021-12-29silence/address unused code warningsDaniel Eades
2021-12-29de-glob importsDaniel Eades
2021-12-29remove 'extern crate' importsDaniel Eades
2021-11-23Merge pull request #251 from conradludgate/value-deserializeMatthias Beyer
rename try_into to try_deserialize to avoid confusion
2021-11-23update tests not use deprecated methodsConrad Ludgate
2021-11-23rename try_into to try_deserialize to avoid confusionConrad Ludgate
2021-06-08Fix: Remove trailing commaMatthias Beyer
Because the old Rust version in the CI fails with this comma in the macro call, we remove it here. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-05-08Use ConfigBuilder in env.rs testsRadosław Kot
2021-05-04Fix env tests, remove unused importJohn Brandt
2021-05-04more environment variable parsing testsJohn Brandt
2021-05-04Renames parse_numbers to try_parsingJoel Gallant
2021-05-04Uses into_* for value conversions and adds bool as an optionJoel Gallant
2021-05-04Adds 'parse_numbers' options for EnvironmentJoel Gallant
This can be particularly helpful for `MY_SERVER_PORT=4334 cargo run`
2021-04-09Ensure order in the galaxy... I mean the importsMatthias Beyer
This patch sorts the imports: 1. std imports 2. external crate imports 3. own module imports In three blocks, each alphabetically (with is also enforced by rustfmt). As well as it prefixes the imports of own modules with crate:: This is just a quality-of-life patch :-) Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-03-26Fix custom separator for group prefixesLyuben Todorov
2018-09-25Use a build config on Environment instead of a feature flag for #78Ryan Leckey
2018-09-26Treat empty environment variables as unsetPhil Booth
2018-07-02Update readme/changelog for 0.9Ryan Leckey
2018-02-13add test for prefix with variant forms of spellingChristian Fochler
2018-01-29add default prefix separatorChristian Fochler
- no need to add '_' to the prefix
2018-01-28add tests for environment handlingChristian Fochler