soft-test-failures

Crates.iosoft-test-failures
lib.rssoft-test-failures
version0.2.1
sourcesrc
created_at2018-11-07 03:33:06.756694
updated_at2024-09-26 04:55:30.449709
descriptionAllow multiple assertions to fail in one test.
homepage
repositoryhttps://github.com/Lytigas/soft-test-failures
max_upload_size
id95177
size4,620
(Lytigas)

documentation

README

Soft-Test-Failures

Multiple test failures, any one of which will result in a failed test. Like gtest's EXPECT_* rather than ASSERT_*.

#[test]
fn expect_failures() {
    let x = 4;
    let y = "is not";
    let z = 5;
    expect!(2 + 2 == 5, "{} surely {} {}", x, y, z);
    expect!(1 + 1 == 2);
    expect!(3 - 7 == -4);
    expect!(3 - 7 == -3);
    let_fail!();
}

running 1 test
test expect_failures ... FAILED

failures:

---- expect_failures stdout ----
thread 'expect_failures' panicked at '`expect` test failed with 2 failed assertions:
1: 4 surely is not 5
2: Expected 3 - 7 == -3
', src/lib.rs:48:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Commit count: 7

cargo fmt