[][src]Module ra_ap_test_utils::mark

This module implements manually tracked test coverage, which is useful for quickly finding a test responsible for testing a particular bit of code.

See https://matklad.github.io/2018/06/18/a-trick-for-test-maintenance.html for details, but the TL;DR is that you write your test as

#[test]
fn test_foo() {
    mark::check!(test_foo);
}

and in the code under test you write

fn foo() {
    if some_condition() {
        mark::hit!(test_foo);
    }
}

This module then checks that executing the test indeed covers the specified function. This is useful if you come back to the foo function ten years later and wonder where the test are: now you can grep for test_foo.

Re-exports

pub use _hit as hit;
pub use _check as check;

Structs

MarkChecker