Add unit test for parse_ack
@@ -41,10 +41,15 @@ pub fn parse_ack(input: &[u8]) -> IResult<&[u8], ()> {
mod tests {
use super::*;
#[test]
- fn it_parses() {
+ fn it_parses_u32() {
assert_eq!(
Ok((&b"extra"[..], 0x12345678)),
parse_u32(b"GU\x12\x34\x56\x78extra")
);
}
+
+ #[test]
+ fn it_parses_ack() {
+ assert_eq!(Ok((&b"extra"[..], ())), parse_ack(b"GU\x06extra"));
+ }
}
