()
| 68 | |
| 69 | #[test] |
| 70 | fn parse_get_command() { |
| 71 | let value = RespValue::array(vec![ |
| 72 | RespValue::bulk_str("get"), |
| 73 | RespValue::bulk_str("mykey"), |
| 74 | ]); |
| 75 | let cmd = RespCommand::parse(&value).unwrap(); |
| 76 | assert_eq!(cmd.name, "GET"); |
| 77 | assert_eq!(cmd.arg(0), Some(b"mykey".as_slice())); |
| 78 | assert_eq!(cmd.argc(), 1); |
| 79 | } |
| 80 | |
| 81 | #[test] |
| 82 | fn parse_set_with_ex() { |