use std::sync::Mutex;
use ratatui::Frame;
use crate::application::Application;
use crate::command::{Action, Command};
use crate::subscription::Subscription;
pub use async_utils::{assert_pending_until, gate_fetches, wait_until};
pub use trace_recorder::TraceRecorder;
mod async_utils;
mod trace_recorder;
pub static PANIC_HOOK_GUARD: Mutex<()> = Mutex::new(());
#[derive(Debug)]
pub struct TestApp {
pub counter: i32,
should_quit: bool,
}
#[derive(Debug, Clone)]
#[allow(dead_code)]
pub enum TestMessage {
Increment,
Quit,
}
impl Application for TestApp {
type Message = TestMessage;
type Flags = i32;
fn new(initial: i32) -> (Self, Command<Self::Message>) {
(
Self {
counter: initial,
should_quit: false,
},
Command::none(),
)
}
fn update(&mut self, msg: Self::Message) -> Command<Self::Message> {
match msg {
TestMessage::Increment => {
self.counter += 1;
Command::none()
}
TestMessage::Quit => {
self.should_quit = true;
Command::effect(Action::Quit)
}
}
}
fn view(&self, _frame: &mut Frame<'_>) {
}
fn subscriptions(&self) -> Vec<Subscription<Self::Message>> {
vec![]
}
}