aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorKunal Mohan <44079328+kunalmohan@users.noreply.github.com>2021-05-06 22:11:07 +0530
committerGitHub <noreply@github.com>2021-05-06 22:11:07 +0530
commitd5433f8f8995c155f231c823d49813882b6212bf (patch)
tree529d5ee706ded18cd24f26a3b0372bf17ecb81ed /src/tests
parentdocs(changelog): Add Manpage #455 (diff)
parentexplicitly set file and directory permissions (diff)
downloadsl0ppij-d5433f8f8995c155f231c823d49813882b6212bf.tar.gz
sl0ppij-d5433f8f8995c155f231c823d49813882b6212bf.tar.xz
sl0ppij-d5433f8f8995c155f231c823d49813882b6212bf.zip
Merge pull request #223 from zellij-org/isolate-pty
Psuedo Client-Server model
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/fakes.rs183
-rw-r--r--src/tests/integration/basic.rs25
-rw-r--r--src/tests/integration/close_pane.rs13
-rw-r--r--src/tests/integration/compatibility.rs21
-rw-r--r--src/tests/integration/layouts.rs7
-rw-r--r--src/tests/integration/move_focus_down.rs2
-rw-r--r--src/tests/integration/move_focus_left.rs2
-rw-r--r--src/tests/integration/move_focus_right.rs2
-rw-r--r--src/tests/integration/move_focus_up.rs2
-rw-r--r--src/tests/integration/resize_down.rs13
-rw-r--r--src/tests/integration/resize_left.rs13
-rw-r--r--src/tests/integration/resize_right.rs13
-rw-r--r--src/tests/integration/resize_up.rs13
-rw-r--r--src/tests/integration/tabs.rs8
-rw-r--r--src/tests/integration/terminal_window_resize.rs28
-rw-r--r--src/tests/integration/toggle_fullscreen.rs2
16 files changed, 275 insertions, 72 deletions
diff --git a/src/tests/fakes.rs b/src/tests/fakes.rs
index 684a24a7..4c780410 100644
--- a/src/tests/fakes.rs
+++ b/src/tests/fakes.rs
@@ -1,19 +1,23 @@
use crate::panes::PositionAndSize;
+use interprocess::local_socket::LocalSocketStream;
use std::collections::{HashMap, VecDeque};
use std::io::Write;
use std::os::unix::io::RawFd;
use std::path::PathBuf;
-use std::sync::{Arc, Condvar, Mutex};
+use std::sync::{mpsc, Arc, Condvar, Mutex};
use std::time::{Duration, Instant};
-use crate::os_input_output::OsApi;
+use crate::client::ClientInstruction;
+use crate::common::{ChannelWithContext, SenderType, SenderWithContext};
+use crate::errors::ErrorContext;
+use crate::os_input_output::{ClientOsApi, ServerOsApi};
+use crate::server::ServerInstruction;
use crate::tests::possible_tty_inputs::{get_possible_tty_inputs, Bytes};
+use crate::tests::utils::commands::{QUIT, SLEEP};
use crate::utils::shared::default_palette;
use zellij_tile::data::Palette;
-use crate::tests::utils::commands::{QUIT, SLEEP};
-
-const MIN_TIME_BETWEEN_SNAPSHOTS: Duration = Duration::from_millis(50);
+const MIN_TIME_BETWEEN_SNAPSHOTS: Duration = Duration::from_millis(150);
#[derive(Clone)]
pub enum IoEvent {
@@ -73,6 +77,10 @@ pub struct FakeInputOutput {
win_sizes: Arc<Mutex<HashMap<RawFd, PositionAndSize>>>,
possible_tty_inputs: HashMap<u16, Bytes>,
last_snapshot_time: Arc<Mutex<Instant>>,
+ send_instructions_to_client: SenderWithContext<ClientInstruction>,
+ receive_instructions_from_server: Arc<Mutex<mpsc::Receiver<(ClientInstruction, ErrorContext)>>>,
+ send_instructions_to_server: SenderWithContext<ServerInstruction>,
+ receive_instructions_from_client: Arc<Mutex<mpsc::Receiver<(ServerInstruction, ErrorContext)>>>,
should_trigger_sigwinch: Arc<(Mutex<bool>, Condvar)>,
sigwinch_event: Option<PositionAndSize>,
}
@@ -82,6 +90,12 @@ impl FakeInputOutput {
let mut win_sizes = HashMap::new();
let last_snapshot_time = Arc::new(Mutex::new(Instant::now()));
let stdout_writer = FakeStdoutWriter::new(last_snapshot_time.clone());
+ let (client_sender, client_receiver): ChannelWithContext<ClientInstruction> =
+ mpsc::channel();
+ let send_instructions_to_client = SenderWithContext::new(SenderType::Sender(client_sender));
+ let (server_sender, server_receiver): ChannelWithContext<ServerInstruction> =
+ mpsc::channel();
+ let send_instructions_to_server = SenderWithContext::new(SenderType::Sender(server_sender));
win_sizes.insert(0, winsize); // 0 is the current terminal
FakeInputOutput {
read_buffers: Arc::new(Mutex::new(HashMap::new())),
@@ -93,6 +107,10 @@ impl FakeInputOutput {
io_events: Arc::new(Mutex::new(vec![])),
win_sizes: Arc::new(Mutex::new(win_sizes)),
possible_tty_inputs: get_possible_tty_inputs(),
+ receive_instructions_from_client: Arc::new(Mutex::new(server_receiver)),
+ send_instructions_to_server,
+ receive_instructions_from_server: Arc::new(Mutex::new(client_receiver)),
+ send_instructions_to_client,
should_trigger_sigwinch: Arc::new((Mutex::new(false), Condvar::new())),
sigwinch_event: None,
}
@@ -116,7 +134,7 @@ impl FakeInputOutput {
}
}
-impl OsApi for FakeInputOutput {
+impl ClientOsApi for FakeInputOutput {
fn get_terminal_size_using_fd(&self, pid: RawFd) -> PositionAndSize {
if let Some(new_position_and_size) = self.sigwinch_event {
let (lock, _cvar) = &*self.should_trigger_sigwinch;
@@ -129,20 +147,6 @@ impl OsApi for FakeInputOutput {
let winsize = win_sizes.get(&pid).unwrap();
*winsize
}
- fn set_terminal_size_using_fd(&mut self, pid: RawFd, cols: u16, rows: u16) {
- let terminal_input = self
- .possible_tty_inputs
- .get(&cols)
- .expect(&format!("could not find input for size {:?}", cols));
- self.read_buffers
- .lock()
- .unwrap()
- .insert(pid, terminal_input.clone());
- self.io_events
- .lock()
- .unwrap()
- .push(IoEvent::SetTerminalSizeUsingFd(pid, cols, rows));
- }
fn set_raw_mode(&mut self, pid: RawFd) {
self.io_events
.lock()
@@ -155,43 +159,7 @@ impl OsApi for FakeInputOutput {
.unwrap()
.push(IoEvent::UnsetRawMode(pid));
}
- fn spawn_terminal(&mut self, _file_to_open: Option<PathBuf>) -> (RawFd, RawFd) {
- let next_terminal_id = self.stdin_writes.lock().unwrap().keys().len() as RawFd + 1;
- self.add_terminal(next_terminal_id);
- (next_terminal_id as i32, next_terminal_id + 1000) // secondary number is arbitrary here
- }
- fn read_from_tty_stdout(&mut self, pid: RawFd, buf: &mut [u8]) -> Result<usize, nix::Error> {
- let mut read_buffers = self.read_buffers.lock().unwrap();
- let mut bytes_read = 0;
- match read_buffers.get_mut(&pid) {
- Some(bytes) => {
- for i in bytes.read_position..bytes.content.len() {
- bytes_read += 1;
- buf[i] = bytes.content[i];
- }
- if bytes_read > bytes.read_position {
- bytes.set_read_position(bytes_read);
- }
- return Ok(bytes_read);
- }
- None => Err(nix::Error::Sys(nix::errno::Errno::EAGAIN)),
- }
- }
- fn write_to_tty_stdin(&mut self, pid: RawFd, buf: &mut [u8]) -> Result<usize, nix::Error> {
- let mut stdin_writes = self.stdin_writes.lock().unwrap();
- let write_buffer = stdin_writes.get_mut(&pid).unwrap();
- let mut bytes_written = 0;
- for byte in buf {
- bytes_written += 1;
- write_buffer.push(*byte);
- }
- Ok(bytes_written)
- }
- fn tcdrain(&mut self, pid: RawFd) -> Result<(), nix::Error> {
- self.io_events.lock().unwrap().push(IoEvent::TcDrain(pid));
- Ok(())
- }
- fn box_clone(&self) -> Box<dyn OsApi> {
+ fn box_clone(&self) -> Box<dyn ClientOsApi> {
Box::new((*self).clone())
}
fn read_from_stdin(&self) -> Vec<u8> {
@@ -213,30 +181,115 @@ impl OsApi for FakeInputOutput {
std::thread::sleep(std::time::Duration::from_millis(200));
} else if command == QUIT && self.sigwinch_event.is_some() {
let (lock, cvar) = &*self.should_trigger_sigwinch;
- let mut should_trigger_sigwinch = lock.lock().unwrap();
- *should_trigger_sigwinch = true;
+ {
+ let mut should_trigger_sigwinch = lock.lock().unwrap();
+ *should_trigger_sigwinch = true;
+ }
cvar.notify_one();
::std::thread::sleep(MIN_TIME_BETWEEN_SNAPSHOTS); // give some time for the app to resize before quitting
+ } else if command == QUIT {
+ ::std::thread::sleep(MIN_TIME_BETWEEN_SNAPSHOTS);
}
command
}
fn get_stdout_writer(&self) -> Box<dyn Write> {
Box::new(self.stdout_writer.clone())
}
- fn kill(&mut self, fd: RawFd) -> Result<(), nix::Error> {
- self.io_events.lock().unwrap().push(IoEvent::Kill(fd));
- Ok(())
+ fn send_to_server(&self, msg: ServerInstruction) {
+ self.send_instructions_to_server.send(msg).unwrap();
+ }
+ fn recv_from_server(&self) -> (ClientInstruction, ErrorContext) {
+ self.receive_instructions_from_server
+ .lock()
+ .unwrap()
+ .recv()
+ .unwrap()
}
fn receive_sigwinch(&self, cb: Box<dyn Fn()>) {
if self.sigwinch_event.is_some() {
let (lock, cvar) = &*self.should_trigger_sigwinch;
- let mut should_trigger_sigwinch = lock.lock().unwrap();
- while !*should_trigger_sigwinch {
- should_trigger_sigwinch = cvar.wait(should_trigger_sigwinch).unwrap();
+ {
+ let mut should_trigger_sigwinch = lock.lock().unwrap();
+ while !*should_trigger_sigwinch {
+ should_trigger_sigwinch = cvar.wait(should_trigger_sigwinch).unwrap();
+ }
}
cb();
}
}
+ fn connect_to_server(&self) {}
+}
+
+impl ServerOsApi for FakeInputOutput {
+ fn set_terminal_size_using_fd(&mut self, pid: RawFd, cols: u16, rows: u16) {
+ let terminal_input = self
+ .possible_tty_inputs
+ .get(&cols)
+ .expect(&format!("could not find input for size {:?}", cols));
+ self.read_buffers
+ .lock()
+ .unwrap()
+ .insert(pid, terminal_input.clone());
+ self.io_events
+ .lock()
+ .unwrap()
+ .push(IoEvent::SetTerminalSizeUsingFd(pid, cols, rows));
+ }
+ fn spawn_terminal(&mut self, _file_to_open: Option<PathBuf>) -> (RawFd, RawFd) {
+ let next_terminal_id = self.stdin_writes.lock().unwrap().keys().len() as RawFd + 1;
+ self.add_terminal(next_terminal_id);
+ (next_terminal_id as i32, next_terminal_id + 1000) // secondary number is arbitrary here
+ }
+ fn write_to_tty_stdin(&mut self, pid: RawFd, buf: &mut [u8]) -> Result<usize, nix::Error> {
+ let mut stdin_writes = self.stdin_writes.lock().unwrap();
+ let write_buffer = stdin_writes.get_mut(&pid).unwrap();
+ let mut bytes_written = 0;
+ for byte in buf {
+ bytes_written += 1;
+ write_buffer.push(*byte);
+ }
+ Ok(bytes_written)
+ }
+ fn read_from_tty_stdout(&mut self, pid: RawFd, buf: &mut [u8]) -> Result<usize, nix::Error> {
+ let mut read_buffers = self.read_buffers.lock().unwrap();
+ let mut bytes_read = 0;
+ match read_buffers.get_mut(&pid) {
+ Some(bytes) => {
+ for i in bytes.read_position..bytes.content.len() {
+ bytes_read += 1;
+ buf[i] = bytes.content[i];
+ }
+ if bytes_read > bytes.read_position {
+ bytes.set_read_position(bytes_read);
+ }
+ return Ok(bytes_read);
+ }
+ None => Err(nix::Error::Sys(nix::errno::Errno::EAGAIN)),
+ }
+ }
+ fn tcdrain(&mut self, pid: RawFd) -> Result<(), nix::Error> {
+ self.io_events.lock().unwrap().push(IoEvent::TcDrain(pid));
+ Ok(())
+ }
+ fn box_clone(&self) -> Box<dyn ServerOsApi> {
+ Box::new((*self).clone())
+ }
+ fn kill(&mut self, fd: RawFd) -> Result<(), nix::Error> {
+ self.io_events.lock().unwrap().push(IoEvent::Kill(fd));
+ Ok(())
+ }
+ fn recv_from_client(&self) -> (ServerInstruction, ErrorContext) {
+ self.receive_instructions_from_client
+ .lock()
+ .unwrap()
+ .recv()
+ .unwrap()
+ }
+ fn send_to_client(&self, msg: ClientInstruction) {
+ self.send_instructions_to_client.send(msg).unwrap();
+ }
+ fn add_client_sender(&mut self) {}
+ fn update_receiver(&mut self, _stream: LocalSocketStream) {}
fn load_palette(&self) -> Palette {
default_palette()
}
diff --git a/src/tests/integration/basic.rs b/src/tests/integration/basic.rs
index f785666a..c8305cab 100644
--- a/src/tests/integration/basic.rs
+++ b/src/tests/integration/basic.rs
@@ -30,6 +30,7 @@ pub fn starts_with_one_terminal() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -57,6 +58,7 @@ pub fn split_terminals_vertically() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -84,6 +86,7 @@ pub fn split_terminals_horizontally() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -118,6 +121,7 @@ pub fn split_largest_terminal() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -145,6 +149,7 @@ pub fn cannot_split_terminals_vertically_when_active_terminal_is_too_small() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -172,6 +177,7 @@ pub fn cannot_split_terminals_horizontally_when_active_terminal_is_too_small() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -199,6 +205,7 @@ pub fn cannot_split_largest_terminal_when_there_is_no_room() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -234,6 +241,7 @@ pub fn scrolling_up_inside_a_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -271,6 +279,7 @@ pub fn scrolling_down_inside_a_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -305,6 +314,7 @@ pub fn scrolling_page_up_inside_a_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -342,6 +352,7 @@ pub fn scrolling_page_down_inside_a_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -377,7 +388,12 @@ pub fn max_panes() {
]);
let mut opts = CliArgs::default();
opts.max_panes = Some(4);
- start(Box::new(fake_input_output.clone()), opts, Config::default());
+ start(
+ Box::new(fake_input_output.clone()),
+ opts,
+ Box::new(fake_input_output.clone()),
+ Config::default(),
+ );
let output_frames = fake_input_output
.stdout_writer
.output_frames
@@ -409,7 +425,12 @@ pub fn toggle_focused_pane_fullscreen() {
]);
let mut opts = CliArgs::default();
opts.max_panes = Some(4);
- start(Box::new(fake_input_output.clone()), opts, Config::default());
+ start(
+ Box::new(fake_input_output.clone()),
+ opts,
+ Box::new(fake_input_output.clone()),
+ Config::default(),
+ );
let output_frames = fake_input_output
.stdout_writer
.output_frames
diff --git a/src/tests/integration/close_pane.rs b/src/tests/integration/close_pane.rs
index f73f4027..869debed 100644
--- a/src/tests/integration/close_pane.rs
+++ b/src/tests/integration/close_pane.rs
@@ -43,6 +43,7 @@ pub fn close_pane_with_another_pane_above_it() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -85,6 +86,7 @@ pub fn close_pane_with_another_pane_below_it() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -124,6 +126,7 @@ pub fn close_pane_with_another_pane_to_the_left() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -164,6 +167,7 @@ pub fn close_pane_with_another_pane_to_the_right() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -209,6 +213,7 @@ pub fn close_pane_with_multiple_panes_above_it() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -252,6 +257,7 @@ pub fn close_pane_with_multiple_panes_below_it() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -297,6 +303,7 @@ pub fn close_pane_with_multiple_panes_to_the_left() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -340,6 +347,7 @@ pub fn close_pane_with_multiple_panes_to_the_right() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -405,6 +413,7 @@ pub fn close_pane_with_multiple_panes_above_it_away_from_screen_edges() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -466,6 +475,7 @@ pub fn close_pane_with_multiple_panes_below_it_away_from_screen_edges() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -529,6 +539,7 @@ pub fn close_pane_with_multiple_panes_to_the_left_away_from_screen_edges() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -592,6 +603,7 @@ pub fn close_pane_with_multiple_panes_to_the_right_away_from_screen_edges() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -628,6 +640,7 @@ pub fn closing_last_pane_exits_app() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
diff --git a/src/tests/integration/compatibility.rs b/src/tests/integration/compatibility.rs
index ef93135e..77d3b67e 100644
--- a/src/tests/integration/compatibility.rs
+++ b/src/tests/integration/compatibility.rs
@@ -41,10 +41,12 @@ pub fn run_bandwhich_from_fish_shell() {
};
let fixture_name = "fish_and_bandwhich";
let mut fake_input_output = get_fake_os_input(&fake_win_size, fixture_name);
+
fake_input_output.add_terminal_input(&[&QUIT]);
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -73,6 +75,7 @@ pub fn fish_tab_completion_options() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -106,6 +109,7 @@ pub fn fish_select_tab_completion_options() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -143,6 +147,7 @@ pub fn vim_scroll_region_down() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -177,6 +182,7 @@ pub fn vim_ctrl_d() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -210,6 +216,7 @@ pub fn vim_ctrl_u() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -238,6 +245,7 @@ pub fn htop() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -266,6 +274,7 @@ pub fn htop_scrolling() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -294,6 +303,7 @@ pub fn htop_right_scrolling() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -330,6 +340,7 @@ pub fn vim_overwrite() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -361,6 +372,7 @@ pub fn clear_scroll_region() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -389,6 +401,7 @@ pub fn display_tab_characters_properly() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -417,6 +430,7 @@ pub fn neovim_insert_mode() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -447,6 +461,7 @@ pub fn bash_cursor_linewrap() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -477,6 +492,7 @@ pub fn fish_paste_multiline() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -505,6 +521,7 @@ pub fn git_log() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -535,6 +552,7 @@ pub fn git_diff_scrollup() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -563,6 +581,7 @@ pub fn emacs_longbuf() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -591,6 +610,7 @@ pub fn top_and_quit() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
@@ -625,6 +645,7 @@ pub fn exa_plus_omf_theme() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
let output_frames = fake_input_output
diff --git a/src/tests/integration/layouts.rs b/src/tests/integration/layouts.rs
index a2ac4702..a07995f6 100644
--- a/src/tests/integration/layouts.rs
+++ b/src/tests/integration/layouts.rs
@@ -28,7 +28,12 @@ pub fn accepts_basic_layout() {
"src/tests/fixtures/layouts/three-panes-with-nesting.yaml",
));
- start(Box::new(fake_input_output.clone()), opts, Config::default());
+ start(
+ Box::new(fake_input_output.clone()),
+ opts,
+ Box::new(fake_input_output.clone()),
+ Config::default(),
+ );
let output_frames = fake_input_output
.stdout_writer
.output_frames
diff --git a/src/tests/integration/move_focus_down.rs b/src/tests/integration/move_focus_down.rs
index 21fa7925..8ea953c6 100644
--- a/src/tests/integration/move_focus_down.rs
+++ b/src/tests/integration/move_focus_down.rs
@@ -35,6 +35,7 @@ pub fn move_focus_down() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -71,6 +72,7 @@ pub fn move_focus_down_to_the_most_recently_used_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
diff --git a/src/tests/integration/move_focus_left.rs b/src/tests/integration/move_focus_left.rs
index 6441357d..3b87bb95 100644
--- a/src/tests/integration/move_focus_left.rs
+++ b/src/tests/integration/move_focus_left.rs
@@ -34,6 +34,7 @@ pub fn move_focus_left() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -71,6 +72,7 @@ pub fn move_focus_left_to_the_most_recently_used_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
diff --git a/src/tests/integration/move_focus_right.rs b/src/tests/integration/move_focus_right.rs
index bc4f551c..c6c17a75 100644
--- a/src/tests/integration/move_focus_right.rs
+++ b/src/tests/integration/move_focus_right.rs
@@ -35,6 +35,7 @@ pub fn move_focus_right() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -71,6 +72,7 @@ pub fn move_focus_right_to_the_most_recently_used_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
diff --git a/src/tests/integration/move_focus_up.rs b/src/tests/integration/move_focus_up.rs
index 77f06703..62b64ed1 100644
--- a/src/tests/integration/move_focus_up.rs
+++ b/src/tests/integration/move_focus_up.rs
@@ -34,6 +34,7 @@ pub fn move_focus_up() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -71,6 +72,7 @@ pub fn move_focus_up_to_the_most_recently_used_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
diff --git a/src/tests/integration/resize_down.rs b/src/tests/integration/resize_down.rs
index d5ad4ef8..58104fe1 100644
--- a/src/tests/integration/resize_down.rs
+++ b/src/tests/integration/resize_down.rs
@@ -46,6 +46,7 @@ pub fn resize_down_with_pane_above() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -90,6 +91,7 @@ pub fn resize_down_with_pane_below() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -140,6 +142,7 @@ pub fn resize_down_with_panes_above_and_below() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -189,6 +192,7 @@ pub fn resize_down_with_multiple_panes_above() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -240,6 +244,7 @@ pub fn resize_down_with_panes_above_aligned_left_with_current_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -290,6 +295,7 @@ pub fn resize_down_with_panes_below_aligned_left_with_current_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -338,6 +344,7 @@ pub fn resize_down_with_panes_above_aligned_right_with_current_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -387,6 +394,7 @@ pub fn resize_down_with_panes_below_aligned_right_with_current_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -439,6 +447,7 @@ pub fn resize_down_with_panes_above_aligned_left_and_right_with_current_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -493,6 +502,7 @@ pub fn resize_down_with_panes_below_aligned_left_and_right_with_current_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -564,6 +574,7 @@ pub fn resize_down_with_panes_above_aligned_left_and_right_with_panes_to_the_lef
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -637,6 +648,7 @@ pub fn resize_down_with_panes_below_aligned_left_and_right_with_to_the_left_and_
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -678,6 +690,7 @@ pub fn cannot_resize_down_when_pane_below_is_at_minimum_height() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
diff --git a/src/tests/integration/resize_left.rs b/src/tests/integration/resize_left.rs
index 2444f3a1..d31dd6d2 100644
--- a/src/tests/integration/resize_left.rs
+++ b/src/tests/integration/resize_left.rs
@@ -42,6 +42,7 @@ pub fn resize_left_with_pane_to_the_left() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -84,6 +85,7 @@ pub fn resize_left_with_pane_to_the_right() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -128,6 +130,7 @@ pub fn resize_left_with_panes_to_the_left_and_right() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -175,6 +178,7 @@ pub fn resize_left_with_multiple_panes_to_the_left() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -224,6 +228,7 @@ pub fn resize_left_with_panes_to_the_left_aligned_top_with_current_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -270,6 +275,7 @@ pub fn resize_left_with_panes_to_the_right_aligned_top_with_current_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -318,6 +324,7 @@ pub fn resize_left_with_panes_to_the_left_aligned_bottom_with_current_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -365,6 +372,7 @@ pub fn resize_left_with_panes_to_the_right_aligned_bottom_with_current_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -417,6 +425,7 @@ pub fn resize_left_with_panes_to_the_left_aligned_top_and_bottom_with_current_pa
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -471,6 +480,7 @@ pub fn resize_left_with_panes_to_the_right_aligned_top_and_bottom_with_current_p
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -542,6 +552,7 @@ pub fn resize_left_with_panes_to_the_left_aligned_top_and_bottom_with_panes_abov
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -616,6 +627,7 @@ pub fn resize_left_with_panes_to_the_right_aligned_top_and_bottom_with_panes_abo
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -657,6 +669,7 @@ pub fn cannot_resize_left_when_pane_to_the_left_is_at_minimum_width() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
diff --git a/src/tests/integration/resize_right.rs b/src/tests/integration/resize_right.rs
index 3f242f5a..e5ea1b9d 100644
--- a/src/tests/integration/resize_right.rs
+++ b/src/tests/integration/resize_right.rs
@@ -42,6 +42,7 @@ pub fn resize_right_with_pane_to_the_left() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -84,6 +85,7 @@ pub fn resize_right_with_pane_to_the_right() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -128,6 +130,7 @@ pub fn resize_right_with_panes_to_the_left_and_right() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -175,6 +178,7 @@ pub fn resize_right_with_multiple_panes_to_the_left() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -224,6 +228,7 @@ pub fn resize_right_with_panes_to_the_left_aligned_top_with_current_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -270,6 +275,7 @@ pub fn resize_right_with_panes_to_the_right_aligned_top_with_current_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -318,6 +324,7 @@ pub fn resize_right_with_panes_to_the_left_aligned_bottom_with_current_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -365,6 +372,7 @@ pub fn resize_right_with_panes_to_the_right_aligned_bottom_with_current_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -417,6 +425,7 @@ pub fn resize_right_with_panes_to_the_left_aligned_top_and_bottom_with_current_p
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -471,6 +480,7 @@ pub fn resize_right_with_panes_to_the_right_aligned_top_and_bottom_with_current_
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -542,6 +552,7 @@ pub fn resize_right_with_panes_to_the_left_aligned_top_and_bottom_with_panes_abo
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -615,6 +626,7 @@ pub fn resize_right_with_panes_to_the_right_aligned_top_and_bottom_with_panes_ab
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -656,6 +668,7 @@ pub fn cannot_resize_right_when_pane_to_the_left_is_at_minimum_width() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
diff --git a/src/tests/integration/resize_up.rs b/src/tests/integration/resize_up.rs
index e2d0c4ba..14819331 100644
--- a/src/tests/integration/resize_up.rs
+++ b/src/tests/integration/resize_up.rs
@@ -44,6 +44,7 @@ pub fn resize_up_with_pane_above() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -88,6 +89,7 @@ pub fn resize_up_with_pane_below() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -137,6 +139,7 @@ pub fn resize_up_with_panes_above_and_below() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -185,6 +188,7 @@ pub fn resize_up_with_multiple_panes_above() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -234,6 +238,7 @@ pub fn resize_up_with_panes_above_aligned_left_with_current_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -284,6 +289,7 @@ pub fn resize_up_with_panes_below_aligned_left_with_current_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -332,6 +338,7 @@ pub fn resize_up_with_panes_above_aligned_right_with_current_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -381,6 +388,7 @@ pub fn resize_up_with_panes_below_aligned_right_with_current_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -433,6 +441,7 @@ pub fn resize_up_with_panes_above_aligned_left_and_right_with_current_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -487,6 +496,7 @@ pub fn resize_up_with_panes_below_aligned_left_and_right_with_current_pane() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -558,6 +568,7 @@ pub fn resize_up_with_panes_above_aligned_left_and_right_with_panes_to_the_left_
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -631,6 +642,7 @@ pub fn resize_up_with_panes_below_aligned_left_and_right_with_to_the_left_and_ri
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -672,6 +684,7 @@ pub fn cannot_resize_up_when_pane_above_is_at_minimum_height() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
diff --git a/src/tests/integration/tabs.rs b/src/tests/integration/tabs.rs
index f62ad0c4..0c751634 100644
--- a/src/tests/integration/tabs.rs
+++ b/src/tests/integration/tabs.rs
@@ -36,6 +36,7 @@ pub fn open_new_tab() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -71,6 +72,7 @@ pub fn switch_to_prev_tab() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -106,6 +108,7 @@ pub fn switch_to_next_tab() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -141,6 +144,7 @@ pub fn close_tab() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -177,6 +181,7 @@ pub fn close_last_pane_in_a_tab() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -215,6 +220,7 @@ pub fn close_the_middle_tab() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -258,6 +264,7 @@ pub fn close_the_tab_that_has_a_pane_in_fullscreen() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -293,6 +300,7 @@ pub fn closing_last_tab_exits_the_app() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
diff --git a/src/tests/integration/terminal_window_resize.rs b/src/tests/integration/terminal_window_resize.rs
index ebea82c0..057c2523 100644
--- a/src/tests/integration/terminal_window_resize.rs
+++ b/src/tests/integration/terminal_window_resize.rs
@@ -30,7 +30,12 @@ pub fn window_width_decrease_with_one_pane() {
..Default::default()
});
let opts = CliArgs::default();
- start(Box::new(fake_input_output.clone()), opts, Config::default());
+ start(
+ Box::new(fake_input_output.clone()),
+ opts,
+ Box::new(fake_input_output.clone()),
+ Config::default(),
+ );
let output_frames = fake_input_output
.stdout_writer
.output_frames
@@ -61,7 +66,12 @@ pub fn window_width_increase_with_one_pane() {
..Default::default()
});
let opts = CliArgs::default();
- start(Box::new(fake_input_output.clone()), opts, Config::default());
+ start(
+ Box::new(fake_input_output.clone()),
+ opts,
+ Box::new(fake_input_output.clone()),
+ Config::default(),
+ );
let output_frames = fake_input_output
.stdout_writer
.output_frames
@@ -92,7 +102,12 @@ pub fn window_height_increase_with_one_pane() {
..Default::default()
});
let opts = CliArgs::default();
- start(Box::new(fake_input_output.clone()), opts, Config::default());
+ start(
+ Box::new(fake_input_output.clone()),
+ opts,
+ Box::new(fake_input_output.clone()),
+ Config::default(),
+ );
let output_frames = fake_input_output
.stdout_writer
.output_frames
@@ -123,7 +138,12 @@ pub fn window_width_and_height_decrease_with_one_pane() {
..Default::default()
});
let opts = CliArgs::default();
- start(Box::new(fake_input_output.clone()), opts, Config::default());
+ start(
+ Box::new(fake_input_output.clone()),
+ opts,
+ Box::new(fake_input_output.clone()),
+ Config::default(),
+ );
let output_frames = fake_input_output
.stdout_writer
.output_frames
diff --git a/src/tests/integration/toggle_fullscreen.rs b/src/tests/integration/toggle_fullscreen.rs
index 9fd22144..0e967bd2 100644
--- a/src/tests/integration/toggle_fullscreen.rs
+++ b/src/tests/integration/toggle_fullscreen.rs
@@ -35,6 +35,7 @@ pub fn adding_new_terminal_in_fullscreen() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);
@@ -69,6 +70,7 @@ pub fn move_focus_is_disabled_in_fullscreen() {
start(
Box::new(fake_input_output.clone()),
CliArgs::default(),
+ Box::new(fake_input_output.clone()),
Config::default(),
);