Skip to content

Commit

Permalink
Add coverage for empty body types
Browse files Browse the repository at this point in the history
  • Loading branch information
cmanallen committed Dec 7, 2022
1 parent 92862de commit 5593280
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions relay-replays/src/recording.rs
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,23 @@ mod tests {
}
}

#[test]
fn test_process_recording_no_contents() {
// Empty payload can not be decompressed. Header check never fails.
let payload: [u8; 0] = [];

let result = recording::process_recording(&payload);
match result {
Ok(_) => unreachable!(),
Err(e) => match e {
recording::RecordingParseError::IoError(er) => {
assert_eq!(er.to_string(), "corrupt deflate stream".to_string())
}
_ => unreachable!(),
},
}
}

// RRWeb Payload Coverage

#[test]
Expand Down

0 comments on commit 5593280

Please sign in to comment.