io-test-util 0.1.0

Collection of utilities for testing failure of io components.
Documentation
  • Coverage
  • 100%
    3 out of 3 items documented1 out of 1 items with examples
  • Size
  • Source code size: 2.46 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.43 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Leopard2A5

IO Test Util

Collection of utilities for testing failure of io components, e.g. std::io::Read.

Usage

In your Cargo.toml:

[dev-dependencies]
io-test-util = "*"

In your test:

extern crate io_test_util;
use io_test_util::ErrReader;
use std::io::{ErrorKind, Read};

pub fn main() {
    let mut reader = ErrReader::new(ErrorKind::BrokenPipe);
    let res = reader.read(&mut[0; 1]);
    assert!(res.is_err());
}