tree: 1b327fd0fa21ab6de6bb171296cd241b37f7f766 [path history] [tgz]
  1. src/
  2. tests/
  3. .cargo-checksum.json
  4. bors.toml
  5. Cargo.toml
  6. LICENSE-APACHE
  7. LICENSE-MIT
  8. README.md
vendor/cov-mark/README.md

cov-mark

Verify that your tests exercise the conditions you think they are exercising

fn safe_divide(dividend: u32, divisor: u32) -> u32 {
    if divisor == 0 {
        cov_mark::hit!(save_divide_zero);
        return 0;
    }
    dividend / divisor
}

#[test]
fn test_safe_divide_by_zero() {
    cov_mark::check!(save_divide_zero);
    assert_eq!(safe_divide(92, 0), 0);
}

See the docs for details