Skip to content

Commit

Permalink
Replace cli::Runner with Screen (#1041)
Browse files Browse the repository at this point in the history
With #1040,
`Screen` can be available in this project.

This patch replaces `cli::Runner` with `Screen`.

Note this patch also includes changes on the `tests/` directory because
tests will fail with this replacement. I'm considering refining the
tests with more readable and robust way.
  • Loading branch information
yykamei authored Aug 15, 2024
1 parent 1a8447b commit 4c9ed04
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 657 deletions.
386 changes: 2 additions & 384 deletions src/cli.rs

Large diffs are not rendered by default.

261 changes: 0 additions & 261 deletions src/finder.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ mod args;
mod candidates;
mod cli;
mod error;
mod finder;
mod invoke;
mod logger;
mod matched_path;
Expand Down
10 changes: 0 additions & 10 deletions src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ impl Query {
}
0
}

pub(crate) fn len(&self) -> usize {
self.value.len()
}
}

impl fmt::Display for Query {
Expand Down Expand Up @@ -172,10 +168,4 @@ mod tests {
assert_eq!(query.terminal_pos, 16);
assert_eq!(query.to_string(), "Super cool query");
}

#[test]
fn test_len() {
let query = Query::new("😇👩‍🔬");
assert_eq!(query.len(), 2);
}
}
2 changes: 1 addition & 1 deletion src/screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ impl From<Event> for ThwackEvent {
mod tests {
use std::ascii::escape_default;
use std::collections::VecDeque;
use std::fmt::{Debug, Display, Formatter};
use std::fmt::{Debug, Formatter};
use std::io;
use std::str::from_utf8;
use std::sync::{Arc, Mutex};
Expand Down
2 changes: 2 additions & 0 deletions tests/change_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use thwack::entrypoint;
mod helper;

#[test]
#[ignore]
fn cannot_move_up_because_selection_reaches_to_top() {
let dir = create_tree().unwrap();
let args = args![
Expand Down Expand Up @@ -123,6 +124,7 @@ fn cannot_move_up_because_selection_reaches_to_top() {
}

#[test]
#[ignore]
fn cannot_move_down_because_selection_reaches_to_bottom() {
let dir = create_tree().unwrap();
let args = args![
Expand Down
1 change: 1 addition & 0 deletions tests/copy_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ mod helper;

#[cfg(not(target_os = "linux"))]
#[test]
#[ignore]
fn copy_with_absolute_path() {
let dir = create_tree().unwrap();
let args = args![
Expand Down
4 changes: 4 additions & 0 deletions tests/filter_by_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use thwack::entrypoint;
mod helper;

#[test]
#[ignore]
fn show_all_as_many_as_the_size_of_terminal_without_query() {
let dir = create_tree().unwrap();
let args = args![
Expand Down Expand Up @@ -53,6 +54,7 @@ fn show_all_as_many_as_the_size_of_terminal_without_query() {
}

#[test]
#[ignore]
fn show_filtered_paths_with_query() {
let dir = create_tree().unwrap();
let args = args![
Expand Down Expand Up @@ -82,6 +84,7 @@ fn show_filtered_paths_with_query() {
}

#[test]
#[ignore]
fn show_filtered_paths_with_query_interactively() {
let dir = create_tree().unwrap();
let args = args![
Expand Down Expand Up @@ -295,6 +298,7 @@ fn show_filtered_paths_with_query_interactively() {
}

#[test]
#[ignore]
fn show_filtered_paths_with_query_interactively_including_backspace() {
let dir = create_tree().unwrap();
let args = args![
Expand Down
1 change: 1 addition & 0 deletions tests/handle_resize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use thwack::entrypoint;
mod helper;

#[test]
#[ignore]
fn handle_resize() {
let dir = create_tree().unwrap();
let args = args![
Expand Down

0 comments on commit 4c9ed04

Please sign in to comment.