[][src]Macro lab_grader::attach

macro_rules! attach {
    ( $rubric:ident, $($stub:literal => $func:ident),* ) => { ... };
}

Attaches tests to criteria in a rubric.

When you create a rubric from yaml, the criteria inside don't have tests attached to them. You can call Rubric.attach() to achieve the same thing, but this is faster and easier.

Example

// A test meant to be attached to a criteria
fn some_test(_: &TestData) -> bool {
    true
}

fn main() {
    let mut rubric = Rubric::from_yaml(/* some yaml data */);
    attach! {
        rubric,
        "some-stub" => some_test
    };
}