flowtest

Crates.ioflowtest
lib.rsflowtest
version0.1.0
sourcesrc
created_at2023-10-31 08:25:36.948907
updated_at2023-10-31 08:25:36.948907
descriptionTests that depend on other tests
homepage
repositoryhttps://github.com/outfoxxed/flowtest
max_upload_size
id1019463
size26,622
(outfoxxed)

documentation

https://docs.rs/flowtest

README

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 {
        Ok(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);
}
Commit count: 3

cargo fmt