1
Fork 0
mirror of https://github.com/Steffo99/micronfig.git synced 2024-11-22 08:04:20 +00:00
micronfig/tests/integration/macros.rs

18 lines
385 B
Rust
Raw Normal View History

2023-05-05 01:13:35 +00:00
use std::env;
micronfig::required!(PLAYER_NAME, String);
micronfig::required!(PLAYER_ID, u64);
micronfig::optional!(IS_SUS, bool);
#[test]
fn test_macros() {
env::set_var("PLAYER_NAME", "Steffo");
env::set_var("PLAYER_ID", "1234");
env::remove_var("IS_SUS");
assert_eq!(*PLAYER_NAME, "Steffo");
assert_eq!(*PLAYER_ID, 1234u64);
assert_eq!(*IS_SUS, None);
}