From fa05e903ade4d63d4a2f0b82d38023e6cf00a878 Mon Sep 17 00:00:00 2001 From: fdai7451 Date: Sat, 21 Jan 2023 18:06:44 +0100 Subject: [PATCH] test: add preprocess set variable test --- src/preprocess.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/preprocess.rs b/src/preprocess.rs index f802b9c..2162753 100644 --- a/src/preprocess.rs +++ b/src/preprocess.rs @@ -22,3 +22,14 @@ pub fn preprocess(line: String) -> Result, ShellError> { Ok(Some(line)) } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_preprocess_env_variable() { + assert_eq!(preprocess("key=value".to_string()), Ok(None)); + assert_eq!(env::var("key").unwrap_or_default(), "value".to_string()) + } +}