소스 검색

Updated tests to test for newlines in Commands.

Lorenz 7 년 전
부모
커밋
f19f0f55f7
1개의 변경된 파일14개의 추가작업 그리고 0개의 파일을 삭제
  1. 14
    0
      hw9/task1/tests/task1.rs

+ 14
- 0
hw9/task1/tests/task1.rs 파일 보기

@@ -45,4 +45,18 @@ mod tests {
45 45
         assert_eq!(parse("RETRIEVE Hello\n"), Ok(Command::Retrieve))
46 46
     }
47 47
 
48
+    #[test]
49
+    fn stage_with_newline_returns_correct_command() {
50
+        assert_eq!(parse("STAGE 123\n456"), Ok(Command::Stage("123".to_string())))
51
+    }
52
+
53
+    #[test]
54
+    fn control_with_newline_returns_correct_command() {
55
+        assert_eq!(parse("Control 123\n456"), Ok(Command::Control("123".to_string())))
56
+    }
57
+
58
+    #[test]
59
+    fn retrieve_with_newline_returns_correct_command() {
60
+        assert_eq!(parse("RETRIEVE 123\n456"), Ok(Command::Retrieve))
61
+    }
48 62
 }

Loading…
취소
저장