Add Codec::set_max_send_frame_size

This commit is contained in:
Carl Lerche
2017-09-05 14:01:32 -07:00
parent c2e6eb35d8
commit 0cc611df35
7 changed files with 81 additions and 25 deletions

View File

@@ -11,6 +11,12 @@ fn read_none() {
assert_closed!(codec);
}
#[test]
fn read_frame_too_big() {
}
// ===== DATA =====
#[test]
fn read_data_no_padding() {
let mut codec = raw_codec! {
@@ -28,6 +34,39 @@ fn read_data_no_padding() {
assert_closed!(codec);
}
#[test]
fn read_data_empty_payload() {
let mut codec = raw_codec! {
read => [
0, 0, 0, 0, 0, 0, 0, 0, 1,
];
};
let data = poll_data!(codec);
assert_eq!(data.stream_id(), 1);
assert_eq!(data.payload(), &b""[..]);
assert!(!data.is_end_stream());
assert_closed!(codec);
}
#[test]
fn read_data_end_stream() {
let mut codec = raw_codec! {
read => [
0, 0, 5, 0, 1, 0, 0, 0, 1,
"hello",
];
};
let data = poll_data!(codec);
assert_eq!(data.stream_id(), 1);
assert_eq!(data.payload(), &b"hello"[..]);
assert!(data.is_end_stream());
assert_closed!(codec);
}
#[test]
fn read_data_padding() {
let mut codec = raw_codec! {
@@ -58,3 +97,17 @@ fn read_data_stream_id_zero() {
poll_err!(codec);
}
// ===== HEADERS =====
#[test]
fn read_headers_without_pseudo() {
}
#[test]
fn read_headers_with_pseudo() {
}
#[test]
fn read_headers_empty_payload() {
}