The dribble
library helps you test implementations of the Rust traits
std::io::Read
and std::io::Write
by passing data to them in small,
random-sized chunks. This allows you to stress-test the code you run near
buffer boundaries.
Place the following in your Cargo.toml
file:
[dev-dependencies]
dribble = "*"
And place the following in your top-level library file:
extern crate dribble;
Reading data in tiny chunks
use ;
use DribbleReader;
let input = b"This is my test data";
let mut cursor = new;
let mut dribble = new;
let mut output = vec!;
dribble.read_to_end.unwrap;
assert_eq!;
Writing data in tiny chunks
use Write;
use DribbleWriter;
let input = b"This is my test data";
let mut output = vec!;
assert_eq!;