Skip to content

Commit

Permalink
Everything passes
Browse files Browse the repository at this point in the history
  • Loading branch information
fasterthanlime committed Aug 21, 2024
1 parent f5bdc2d commit 53f96f4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/loona/src/responder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,10 @@ mod tests {
responder.write_chunk(b"12345".into()).await.unwrap();
let result = responder.finish_body(None).await;
assert!(result.is_err());
assert!(matches!(result, Err(e) if e.to_string().contains("content-length mismatch")));
assert!(matches!(
result,
Err(ResponderError::BodyLengthDoesNotMatchAnnouncedContentLength { .. })
));

// Test writing more bytes than announced
let encoder = MockEncoder;
Expand All @@ -319,7 +322,10 @@ mod tests {
responder.write_chunk(b"12345678901".into()).await.unwrap();
let result = responder.finish_body(None).await;
assert!(result.is_err());
assert!(matches!(result, Err(e) if e.to_string().contains("content-length mismatch")));
assert!(matches!(
result,
Err(ResponderError::BodyLengthDoesNotMatchAnnouncedContentLength { .. })
));
}
}
}

0 comments on commit 53f96f4

Please sign in to comment.