From 44b92ec7aca947adbbc3fa07fa495823460f4539 Mon Sep 17 00:00:00 2001 From: Matt McCoy Date: Tue, 21 Jun 2016 16:16:13 -0400 Subject: [PATCH] Adding test for check --- src/client.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/client.rs b/src/client.rs index 8459013..82620cb 100644 --- a/src/client.rs +++ b/src/client.rs @@ -385,6 +385,19 @@ mod tests { assert!(command2 == expected_command2, "expected command doesn't equal actual command"); } + #[test] + fn check() { + // TODO Make sure the response was read correctly + let response = b"a1 OK CHECK completed\r\n".to_vec(); + let mock_stream = MockStream::new(response); + let mut client = create_client_with_mock_stream(mock_stream); + match client.check() { + Err(err) => panic!("Error reading response: {}", err), + _ => {}, + } + assert!(client.stream.written_buf == b"a1 CHECK\r\n".to_vec(), "Invalid close command"); + } + #[test] fn close() { // TODO Make sure the response was read correctly