Type Definition testresult::TestResult

source ·
pub type TestResult = Result<(), ErrorWithStacktrace>;
Expand description

Unit test result

This type allows panicking when encountering any type of failure. Thus it allows using ? operator in unit tests but still get the complete stacktrace and exact place of failure during tests.

Examples

use testresult::TestResult;

#[test]
fn it_works() -> TestResult {
    // ...
    std::fs::File::open("this-file-does-not-exist")?;
    // ...
    Ok(())
}