chromium/third_party/rust/chromium_crates_io/vendor/rstest-0.17.0/tests/resources/fixture/once.rs

use rstest::{fixture, rstest};

#[fixture]
#[once]
fn once_fixture() -> u32 {
    eprintln!("Exec fixture() just once");
    42
}

#[rstest]
fn base(once_fixture: &u32) {
    assert_eq!(&42, once_fixture);
}

#[rstest]
#[case(2)]
#[case(3)]
#[case(7)]
fn cases(once_fixture: &u32, #[case] divisor: u32) {
    assert_eq!(0, *once_fixture % divisor);
}