Açıklama Yok
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

task1.rs 900B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #[cfg(test)]
  2. mod tests {
  3. extern crate task1;
  4. use self::task1::Command;
  5. use self::task1::parse;
  6. #[test]
  7. fn empty_returns_correct_command() {
  8. assert_eq!(parse("\n"), Command::EmptyError)
  9. }
  10. #[test]
  11. fn not_known_command_returns_correct_command() {
  12. assert_eq!(parse("Hello"), Command::NotFoundError)
  13. }
  14. #[test]
  15. fn stage_returns_correct_command() {
  16. assert_eq!(parse("STAGE Hello"), Command::Stage("Hello".to_string()))
  17. }
  18. #[test]
  19. fn control_returns_correct_command() {
  20. assert_eq!(parse("CONTROL Hello"), Command::Control("Hello".to_string()))
  21. }
  22. #[test]
  23. fn retrieve_returns_correct_command() {
  24. assert_eq!(parse("RETRIEVE"), Command::Retrieve)
  25. }
  26. #[test]
  27. fn retrieve_with_arguments_returns_correct_command() {
  28. assert_eq!(parse("RETRIEVE Hello"), Command::Retrieve)
  29. }
  30. }