Browse Source

test: add change prompt args test

main
fdai7451 2 years ago
parent
commit
2d8136033c
  1. 15
      src/builtins/change_prompt.rs

15
src/builtins/change_prompt.rs

@ -34,3 +34,18 @@ impl Builtin for ChangePrompt {
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_change_prompt_no_args() {
assert_ne!(ChangePrompt.execute(&mut BuiltinConfig::new(), vec![]), Ok(()))
}
#[test]
fn test_change_prompt_multiple_args() {
assert_eq!(ChangePrompt.execute(&mut BuiltinConfig::new(), vec!["1".to_string(), "2".to_string()]), Err(ShellError::ExecuteFailure("expected only one argument".to_string())))
}
}
Loading…
Cancel
Save