mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 08:47:18 +02:00
Update test
This commit is contained in:
parent
cca0f254f9
commit
6679da5748
1 changed files with 0 additions and 36 deletions
36
src/main.rs
36
src/main.rs
|
@ -117,39 +117,3 @@ fn tui_main(_config: &str) -> Result<(), Box<dyn Error>> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::util::Key;
|
||||
use crate::util::{destruct_terminal, setup_terminal, Event, EventConfig, Events};
|
||||
use std::time::Duration;
|
||||
|
||||
#[test]
|
||||
fn test_main() {
|
||||
let terminal = setup_terminal();
|
||||
// Setup event handlers
|
||||
let events = Events::with_config(EventConfig {
|
||||
tick_rate: Duration::from_millis(1000),
|
||||
});
|
||||
|
||||
match events.next().unwrap() {
|
||||
Event::Input(Key::Char('g')) => {
|
||||
events.pause_ticker();
|
||||
match events.next().unwrap() {
|
||||
Event::Input(Key::Char('g')) => events.resume_ticker(),
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
Event::Input(input) => {
|
||||
print!("\r\n");
|
||||
dbg!(input);
|
||||
}
|
||||
Event::Tick => {
|
||||
print!("\r\n");
|
||||
dbg!("tick");
|
||||
}
|
||||
};
|
||||
|
||||
destruct_terminal();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue