Added general environment function (#20)

Reviewed-on: #20
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
phoenix
2025-09-29 19:22:10 +00:00
committed by phoenix
parent e51df82f09
commit 0f470ef723
6 changed files with 32 additions and 2 deletions
+19
View File
@@ -59,4 +59,23 @@ mod tests {
result
)
}
#[test]
fn test_get_env() {
let keys = vec![
(
"RANDOM_ENV_KEY",
"YouDon'tWantToButYouGottaChange|It'sGoingToHurtYouTryingToStayTheSame|AreYouInItOrYouInItForTheFame?|I'mTryingToFigureOutWhoLoveMeForMe",
),
(
"MODNAR_ENV_KEY",
"FeelingTheMonsterClimbDeepserInsideOfMe|FeelingHimGnawingMyHeartAwayHungrily|I'llNeverLoseThisPain|NeverDreamOfYouAgain",
),
];
for (key, value) in keys.iter() {
let result = async_std::task::block_on(icarus_envy::environment::get_env(key));
assert_eq!(result, *value, "{:?} does not match {:?}", key, result)
}
}
}