Browse Source

test: add preprocess set variable test

main
fdai7451 2 years ago
parent
commit
fa05e903ad
  1. 11
      src/preprocess.rs

11
src/preprocess.rs

@ -22,3 +22,14 @@ pub fn preprocess(line: String) -> Result<Option<String>, 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())
}
}
Loading…
Cancel
Save