#unit #dependent #dependencies #test

macro flowtest-macro

Tests that depend on other tests

1 unstable release

0.1.0 Oct 31, 2023

#31 in #dependent

Download history 66/week @ 2024-01-08 114/week @ 2024-01-15 38/week @ 2024-01-22 72/week @ 2024-01-29 33/week @ 2024-02-05 89/week @ 2024-02-19 54/week @ 2024-02-26 12/week @ 2024-03-04 9/week @ 2024-03-11 17/week @ 2024-03-18 92/week @ 2024-03-25 38/week @ 2024-04-01 4/week @ 2024-04-08 12/week @ 2024-04-15 10/week @ 2024-04-22

75 downloads per month
Used in flowtest

Apache-2.0 OR MIT

8KB
208 lines

Flowtest

Tests that depend on other tests

See the docs for details.

Example

#[test]
#[flowtest]
fn init_complex_type() -> i32 {
    // test that initialization works for our complex type
    if false { panic!("oh no!") };
    42
}

#[test]
#[flowtest(init_complex_type: value)]
fn mutate_complex_type() -> Result<i32, ComplexTypeInitFailed> {
    // mutate our type in a way that could fail
    if false {
        Err(ComplexTypeInitFailed)
    } else {
        Ok(value + 5)
    }
}

#[test]
#[flowtest(init_complex_type: value)]
fn mutate_complex_type_differently() -> i32 {
    // mutate our type in a different way
    if false {
        panic!("oh no!")
    } else {
        value + 5
    }
}

#[test]
#[flowtest(
    mutate_complex_type,
    mutate_complex_type_differently,
)]
fn ensure_mutations_are_consistent() {
    assert_eq!(mutate_complex_type, mutate_complex_type_differently);
}

Dependencies

~320–770KB
~19K SLoC