Skip to content

Commit

Permalink
unit test for test_decode_nulls: check resp type is nulls
Browse files Browse the repository at this point in the history
  • Loading branch information
rock117 committed Jul 18, 2024
1 parent 7717a78 commit 5393798
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/resp/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,11 @@ mod tests {

#[test]
fn test_decode_nulls() {
let nulls = decode_nulls(b"_\r\n");
assert_eq!(true, nulls.is_ok())
let (remain, resp) = decode_nulls(b"_\r\n").unwrap();
let Nulls(_) = resp else {
panic!("not SimpleStrings")
};
assert_eq!(b"", remain);
}

#[test]
Expand Down

0 comments on commit 5393798

Please sign in to comment.