|
|
@@ -45,6 +45,16 @@ mod tests {
|
|
45
|
45
|
assert_eq!(parse("RETRIEVE Hello\n"), Ok(Command::Retrieve))
|
|
46
|
46
|
}
|
|
47
|
47
|
|
|
|
48
|
+ #[test]
|
|
|
49
|
+ fn empty_with_newline_returns_correct_command() {
|
|
|
50
|
+ assert_eq!(parse("\n12341234\n"), Err(ParseError(ErrorType::EmptyString)))
|
|
|
51
|
+ }
|
|
|
52
|
+
|
|
|
53
|
+ #[test]
|
|
|
54
|
+ fn not_known_command_with_newline_returns_correct_command() {
|
|
|
55
|
+ assert_eq!(parse("Hello\n123\n"), Err(ParseError(ErrorType::UnknownCommand)))
|
|
|
56
|
+ }
|
|
|
57
|
+
|
|
48
|
58
|
#[test]
|
|
49
|
59
|
fn stage_with_newline_returns_correct_command() {
|
|
50
|
60
|
assert_eq!(parse("STAGE 123\n456"), Ok(Command::Stage("123".to_string())))
|