A test frameworked for Rust, inspired by the [Catch] C++ test framework.
```rust
extern crate catch; use catch::*;
fn example() {
let a = 0;
assert_eq!(a, 0);
#[section("first assert succeeds")] {
let b = 0;
assert_eq!(a, b);
#[section("second assert fails")] { assert!(false); }
}
#[section("first assert fails")] {
let b = 1;
assert_eq!(a, b);
#[section("second assert succeeds")] {
// The parent section fails assert so this never gets executed.
// Should result in undefined result.
assert!(true);
}
}
}
// OUTPUT: // // Running target/debug/deps/test-d4d1fd68ce8fee8b // // running 5 tests // test example ... ok // test examplefirstassertfails ... FAILED // test examplefirstassertfailssecondassertsucceeds ... FAILED // test examplefirstassertsucceeds ... ok // test examplefirstassertsucceedssecondassertfails ... FAILED // ```