use super::test_application::ferro_theory;
use std::cell::Cell;
ferroui_base::ferro_thread_local! {
static INSTANCE_COUNT: Cell<i32> = const { Cell::new(0) };
}
struct SetupTests;
impl SetupTests {
fn new() -> Self {
INSTANCE_COUNT.set(INSTANCE_COUNT.get() + 1);
Self
}
}
impl Drop for SetupTests {
fn drop(&mut self) {
INSTANCE_COUNT.set(INSTANCE_COUNT.get() - 1);
}
}
fn setup_tear_down_should_work(_index: i32) {
let _this = SetupTests::new();
assert_eq!(1, INSTANCE_COUNT.get());
}
ferro_theory!(setup_tear_down_should_work {
index_1: (1),
index_2: (2),
});