From e715d7200c52772c9f6c791b6d1fd3af415806e8 Mon Sep 17 00:00:00 2001 From: fdai7451 Date: Sat, 21 Jan 2023 17:38:18 +0100 Subject: [PATCH] test: add change prompt valid and invalid arg test --- src/builtins/change_prompt.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/builtins/change_prompt.rs b/src/builtins/change_prompt.rs index 3b181e5..8aa0fb8 100644 --- a/src/builtins/change_prompt.rs +++ b/src/builtins/change_prompt.rs @@ -48,4 +48,14 @@ mod tests { 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()))) } + + #[test] + fn test_change_prompt_none() { + assert_eq!(ChangePrompt.execute(&mut BuiltinConfig::new(), vec!["none".to_string()]), Ok(())) + } + + #[test] + fn test_change_prompt_invalid_style() { + assert_eq!(ChangePrompt.execute(&mut BuiltinConfig::new(), vec!["notexistent".to_string()]), Err(ShellError::ExecuteFailure("notexistent is not a valid prompt style".to_string()))) + } }