Module assertables::assert_io_read_to_string

source ·
Expand description

Assert macros for comparing input/output reader streams.

These macros help with input/output readers, such as file handles, byte arrays, input streams, the trait std::io::Read, and anything that implements a method read_to_string() -> String.

Compare a reader with another reader:

Compare a reader with an expression:

Compare a reader with its contents:

§Example

use std::io::Read;

let mut a = "alfa".as_bytes();
let mut b = "alfa".as_bytes();
assert_io_read_to_string_eq!(a, b);

Modules§