From 4bce3cd5bca554d93effa5e03a5da098d7c27095 Mon Sep 17 00:00:00 2001 From: fdai7451 Date: Sat, 21 Jan 2023 17:38:33 +0100 Subject: [PATCH] refactoring: fmt change prompt tests --- src/builtins/change_prompt.rs | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/builtins/change_prompt.rs b/src/builtins/change_prompt.rs index 8aa0fb8..bab04f5 100644 --- a/src/builtins/change_prompt.rs +++ b/src/builtins/change_prompt.rs @@ -41,21 +41,40 @@ mod tests { #[test] fn test_change_prompt_no_args() { - assert_ne!(ChangePrompt.execute(&mut BuiltinConfig::new(), vec![]), Ok(())) + 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()))) + 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(())) + 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()))) + assert_eq!( + ChangePrompt.execute(&mut BuiltinConfig::new(), vec!["notexistent".to_string()]), + Err(ShellError::ExecuteFailure( + "notexistent is not a valid prompt style".to_string() + )) + ) } }