Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Darksonn committed Oct 15, 2023
1 parent 7239342 commit f9deaa0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tokio/tests/io_take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ async fn issue_4435() {
assert_eq!(&buf, &b"ABhell\0\0"[..]);
}

#[tokio::test]
async fn issue_6070() {
// make sure it overflows usize on 32bit targets
let mut reader = tokio::io::repeat(0b101).take(u32::MAX as u64 + 1u64);
let copied = tokio::io::copy(&mut reader, &mut tokio::io::sink()).await.unwrap();
assert_eq!(copied, u32::MAX as u64 + 1u64);
}

struct BadReader {
leaked_buffers: LeakedBuffers,
}
Expand Down

0 comments on commit f9deaa0

Please sign in to comment.