diff options
| author | Denis Maximov <denismaximov98@gmail.com> | 2020-11-19 16:30:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-19 15:30:05 +0100 |
| commit | cf43736656e0d9ba0744c687373a60749a92cdb0 (patch) | |
| tree | 9c5ab10a6e1632fe1b4fcb1861cf94c04c5de6f2 /src/tests/integration/basic.rs | |
| parent | fix(compatibility): some fixes for htop (#53) (diff) | |
| download | sl0ppij-cf43736656e0d9ba0744c687373a60749a92cdb0.tar.gz sl0ppij-cf43736656e0d9ba0744c687373a60749a92cdb0.tar.xz sl0ppij-cf43736656e0d9ba0744c687373a60749a92cdb0.zip | |
refactor(data-structures): #51 change winsize to positionandsize (#56)
Diffstat (limited to 'src/tests/integration/basic.rs')
| -rw-r--r-- | src/tests/integration/basic.rs | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/src/tests/integration/basic.rs b/src/tests/integration/basic.rs index 6640b6e6..b3b8c2e6 100644 --- a/src/tests/integration/basic.rs +++ b/src/tests/integration/basic.rs @@ -1,5 +1,5 @@ +use crate::terminal_pane::PositionAndSize; use ::insta::assert_snapshot; -use ::nix::pty::Winsize; use crate::tests::fakes::FakeInputOutput; use crate::tests::utils::commands::{ @@ -9,17 +9,17 @@ use crate::tests::utils::commands::{ use crate::tests::utils::get_output_frame_snapshots; use crate::{start, Opt}; -fn get_fake_os_input(fake_win_size: &Winsize) -> FakeInputOutput { +fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput { FakeInputOutput::new(fake_win_size.clone()) } #[test] pub fn starts_with_one_terminal() { - let fake_win_size = Winsize { - ws_col: 121, - ws_row: 20, - ws_xpixel: 0, - ws_ypixel: 0, + let fake_win_size = PositionAndSize { + columns: 121, + rows: 20, + x: 0, + y: 0, }; let mut fake_input_output = get_fake_os_input(&fake_win_size); fake_input_output.add_terminal_input(&[QUIT]); @@ -37,11 +37,11 @@ pub fn starts_with_one_terminal() { #[test] pub fn split_terminals_vertically() { - let fake_win_size = Winsize { - ws_col: 121, - ws_row: 20, - ws_xpixel: 0, - ws_ypixel: 0, + let fake_win_size = PositionAndSize { + columns: 121, + rows: 20, + x: 0, + y: 0, }; let mut fake_input_output = get_fake_os_input(&fake_win_size); fake_input_output.add_terminal_input(&[SPLIT_VERTICALLY, QUIT]); @@ -59,11 +59,11 @@ pub fn split_terminals_vertically() { #[test] pub fn split_terminals_horizontally() { - let fake_win_size = Winsize { - ws_col: 121, - ws_row: 20, - ws_xpixel: 0, - ws_ypixel: 0, + let fake_win_size = PositionAndSize { + columns: 121, + rows: 20, + x: 0, + y: 0, }; let mut fake_input_output = get_fake_os_input(&fake_win_size); fake_input_output.add_terminal_input(&[SPLIT_HORIZONTALLY, QUIT]); @@ -82,11 +82,11 @@ pub fn split_terminals_horizontally() { #[test] pub fn split_largest_terminal() { // this finds the largest pane and splits along its longest edge (vertically or horizontally) - let fake_win_size = Winsize { - ws_col: 121, - ws_row: 20, - ws_xpixel: 0, - ws_ypixel: 0, + let fake_win_size = PositionAndSize { + columns: 121, + rows: 20, + x: 0, + y: 0, }; let mut fake_input_output = get_fake_os_input(&fake_win_size); fake_input_output.add_terminal_input(&[SPAWN_TERMINAL, SPAWN_TERMINAL, SPAWN_TERMINAL, QUIT]); @@ -119,11 +119,11 @@ pub fn resize_right_and_up_on_the_same_axis() { // │█████│ │ │█████│ │ // └─────┴─────┘ └─────┴─────┘ // █ == focused pane - let fake_win_size = Winsize { - ws_col: 121, - ws_row: 40, - ws_xpixel: 0, - ws_ypixel: 0, + let fake_win_size = PositionAndSize { + columns: 121, + rows: 40, + x: 0, + y: 0, }; let mut fake_input_output = get_fake_os_input(&fake_win_size); @@ -153,11 +153,11 @@ pub fn resize_right_and_up_on_the_same_axis() { #[test] pub fn scrolling_inside_a_pane() { - let fake_win_size = Winsize { - ws_col: 121, - ws_row: 20, - ws_xpixel: 0, - ws_ypixel: 0, + let fake_win_size = PositionAndSize { + columns: 121, + rows: 20, + x: 0, + y: 0, }; let mut fake_input_output = get_fake_os_input(&fake_win_size); fake_input_output.add_terminal_input(&[ @@ -185,11 +185,11 @@ pub fn scrolling_inside_a_pane() { pub fn max_panes() { // with the --max-panes option, we only allow a certain amount of panes on screen // simultaneously, new panes beyond this limit will close older panes on screen - let fake_win_size = Winsize { - ws_col: 121, - ws_row: 20, - ws_xpixel: 0, - ws_ypixel: 0, + let fake_win_size = PositionAndSize { + columns: 121, + rows: 20, + x: 0, + y: 0, }; let mut fake_input_output = get_fake_os_input(&fake_win_size); fake_input_output.add_terminal_input(&[ @@ -215,11 +215,11 @@ pub fn max_panes() { #[test] pub fn toggle_focused_pane_fullscreen() { - let fake_win_size = Winsize { - ws_col: 121, - ws_row: 20, - ws_xpixel: 0, - ws_ypixel: 0, + let fake_win_size = PositionAndSize { + columns: 121, + rows: 20, + x: 0, + y: 0, }; let mut fake_input_output = get_fake_os_input(&fake_win_size); fake_input_output.add_terminal_input(&[ |
