summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Wach <pwach@bloomberg.net>2024-01-20 12:08:03 +0000
committerPiotr Wach <pwach@bloomberg.net>2024-01-20 12:08:03 +0000
commit99b5443f2f8821b0a285320c8ec3f982722cfff8 (patch)
treee879be18751df912dca088c1da8ddd7157a4bb4e
parentdcff2eebed4422f3103d99eac6bd91e56df327c6 (diff)
cargo fmt
-rw-r--r--src/interactive/app/tests/journeys_readonly.rs81
1 files changed, 55 insertions, 26 deletions
diff --git a/src/interactive/app/tests/journeys_readonly.rs b/src/interactive/app/tests/journeys_readonly.rs
index 04a16e7..af1063b 100644
--- a/src/interactive/app/tests/journeys_readonly.rs
+++ b/src/interactive/app/tests/journeys_readonly.rs
@@ -134,42 +134,63 @@ fn simple_user_journey_read_only() -> Result<()> {
// Columns
{
// hit the C key shows the entry count column
- app.process_events(&mut terminal, into_events([
- Event::Key(KeyEvent::new(KeyCode::Char('C'), KeyModifiers::NONE)),
- ]))?;
+ app.process_events(
+ &mut terminal,
+ into_events([Event::Key(KeyEvent::new(
+ KeyCode::Char('C'),
+ KeyModifiers::NONE,
+ ))]),
+ )?;
assert!(app.state.show_columns.contains(&Column::Count));
// when hitting the C key again hides the entry count column
- app.process_events(&mut terminal, into_events([
- Event::Key(KeyEvent::new(KeyCode::Char('C'), KeyModifiers::NONE)),
- ]))?;
+ app.process_events(
+ &mut terminal,
+ into_events([Event::Key(KeyEvent::new(
+ KeyCode::Char('C'),
+ KeyModifiers::NONE,
+ ))]),
+ )?;
assert!(!app.state.show_columns.contains(&Column::Count));
// hit the M key shows the entry count column
- app.process_events(&mut terminal, into_events([
- Event::Key(KeyEvent::new(KeyCode::Char('M'), KeyModifiers::NONE)),
- ]))?;
+ app.process_events(
+ &mut terminal,
+ into_events([Event::Key(KeyEvent::new(
+ KeyCode::Char('M'),
+ KeyModifiers::NONE,
+ ))]),
+ )?;
assert!(app.state.show_columns.contains(&Column::MTime));
// when hitting the M key again hides the entry count column
- app.process_events(&mut terminal, into_events([
- Event::Key(KeyEvent::new(KeyCode::Char('M'), KeyModifiers::NONE)),
- ]))?;
+ app.process_events(
+ &mut terminal,
+ into_events([Event::Key(KeyEvent::new(
+ KeyCode::Char('M'),
+ KeyModifiers::NONE,
+ ))]),
+ )?;
assert!(!app.state.show_columns.contains(&Column::MTime));
}
// Glob pane open/close
{
// '/' shows the glob pane
- app.process_events(&mut terminal, into_events([
- Event::Key(KeyEvent::new(KeyCode::Char('/'), KeyModifiers::NONE)),
- ]))?;
+ app.process_events(
+ &mut terminal,
+ into_events([Event::Key(KeyEvent::new(
+ KeyCode::Char('/'),
+ KeyModifiers::NONE,
+ ))]),
+ )?;
assert!(app.window.glob_pane.is_some());
// ESC closes the glob pane
- app.process_events(&mut terminal, into_events([
- Event::Key(KeyEvent::new(KeyCode::Esc, KeyModifiers::NONE)),
- ]))?;
+ app.process_events(
+ &mut terminal,
+ into_events([Event::Key(KeyEvent::new(KeyCode::Esc, KeyModifiers::NONE))]),
+ )?;
assert!(app.window.glob_pane.is_none());
}
@@ -178,11 +199,15 @@ fn simple_user_journey_read_only() -> Result<()> {
assert!(app.state.scan.is_none());
// 'R' refreshes all entries in the view
- app.process_events(&mut terminal, into_events([
- Event::Key(KeyEvent::new(KeyCode::Char('R'), KeyModifiers::NONE)),
- ]))?;
+ app.process_events(
+ &mut terminal,
+ into_events([Event::Key(KeyEvent::new(
+ KeyCode::Char('R'),
+ KeyModifiers::NONE,
+ ))]),
+ )?;
assert!(app.state.scan.is_some());
-
+
// refresh should finish eventually
app.run_until_traversed(&mut terminal, into_events([]))?;
assert!(app.state.scan.is_none());
@@ -201,11 +226,15 @@ fn simple_user_journey_read_only() -> Result<()> {
);
// 'R' refreshes all entries in the view
- app.process_events(&mut terminal, into_events([
- Event::Key(KeyEvent::new(KeyCode::Char('R'), KeyModifiers::NONE)),
- ]))?;
+ app.process_events(
+ &mut terminal,
+ into_events([Event::Key(KeyEvent::new(
+ KeyCode::Char('R'),
+ KeyModifiers::NONE,
+ ))]),
+ )?;
assert!(app.state.scan.is_some());
-
+
// Refresh should finish
app.run_until_traversed(&mut terminal, into_events([]))?;
assert!(app.state.scan.is_none());