diff --git a/src/commands/parser.rs b/src/commands/parser.rs index d04e09d..3ad9c6a 100644 --- a/src/commands/parser.rs +++ b/src/commands/parser.rs @@ -87,11 +87,26 @@ mod tests { } #[test] - fn just_exclamation_point_test() { + fn just_exclamation_mark_test() { let result = parse_command("!"); assert!(result.is_err()); } + #[test] + fn word_with_exclamation_mark_test() { + let result1 = parse_command("hello !notacommand"); + assert!(result1.is_ok()); + assert!(result1.unwrap().1.is_none()); + + let result2 = parse_command("hello!"); + assert!(result2.is_ok()); + assert!(result2.unwrap().1.is_none()); + + let result3 = parse_command("hello!notacommand"); + assert!(result3.is_ok()); + assert!(result3.unwrap().1.is_none()); + } + #[test] fn basic_command_test() { assert_eq!(