wip: test: fixing up the tests

- should bring back the rest of the mental model
- and allow me to prune it!
This commit is contained in:
same mf who else 2026-02-20 14:25:08 +02:00
parent ce2eeaee7f
commit 2a7e981b9c
5 changed files with 93 additions and 95 deletions

View file

@ -4,10 +4,10 @@ use rand::{thread_rng, distributions::uniform::UniformSampler};
impl Tui {
/// Create and launch a terminal user interface.
pub fn run <T: Send + Sync + Handle<TuiIn> + Draw<TuiOut> + 'static> (
state: &Arc<RwLock<T>>
) -> Usually<Arc<RwLock<Self>>> {
tui_run(state)
pub fn run <T> (join: bool, state: T) -> Usually<Arc<RwLock<Self>>> where
T: Handle<TuiIn> + Draw<TuiOut> + Send + Sync + 'static
{
tui_run(join, &Arc::new(RwLock::new(state)))
}
/// True if done
pub fn exited (&self) -> bool { self.exited.fetch_and(true, Relaxed) }