add tests

pull/99/head
Takayuki Maeda 3 years ago
parent 46e2f3081c
commit f79f8a61b9

@ -495,3 +495,22 @@ impl App {
Ok(EventState::NotConsumed)
}
}
#[cfg(test)]
mod test {
use super::{App, Config, EventState, Key};
fn test_extend_or_shorten_widget_width() {
let mut app = App::new(Config::default());
assert_eq!(
app.extend_or_shorten_widget_width(Key::Char('<')).unwrap(),
EventState::Consumed
);
aasert_eq!(app.left_chunk_percentage, )
assert_eq!(
app.extend_or_shorten_widget_width(Key::Char('>')).unwrap(),
EventState::Consumed
);
}
}

@ -37,7 +37,7 @@ use std::convert::TryInto;
use tui::{backend::Backend, layout::Rect, Frame};
use unicode_width::UnicodeWidthChar;
#[derive(PartialEq)]
#[derive(PartialEq, Debug)]
pub enum EventState {
Consumed,
NotConsumed,

Loading…
Cancel
Save