mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-02 00:00:11 +02:00
test: implement Drop for Mock to panic w/ unconsumed data (#2704)
This commit is contained in:
@@ -70,3 +70,17 @@ async fn write_error() {
|
||||
|
||||
mock.write_all(b"world!").await.expect("write 2");
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[should_panic]
|
||||
async fn mock_panics_read_data_left() {
|
||||
use tokio_test::io::Builder;
|
||||
Builder::new().read(b"read").build();
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[should_panic]
|
||||
async fn mock_panics_write_data_left() {
|
||||
use tokio_test::io::Builder;
|
||||
Builder::new().write(b"write").build();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user