diff options
| author | Aram Drevekenin <aram@poor.dev> | 2020-11-06 18:12:03 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-06 18:12:03 +0100 |
| commit | 13af16b3360dddc8aede1e7c429696b115fadd6d (patch) | |
| tree | f1102cfde94ee9f2d8dc10eb93c79884790b8eaf /src/tests | |
| parent | docs(architecture): fix title (diff) | |
| download | sl0ppij-13af16b3360dddc8aede1e7c429696b115fadd6d.tar.gz sl0ppij-13af16b3360dddc8aede1e7c429696b115fadd6d.tar.xz sl0ppij-13af16b3360dddc8aede1e7c429696b115fadd6d.zip | |
fix(scroll): support show/hide cursor and fix vim scrolling behaviour (#27)
Diffstat (limited to 'src/tests')
4 files changed, 10 insertions, 8 deletions
diff --git a/src/tests/integration/basic.rs b/src/tests/integration/basic.rs index 7067c8f6..eb542f95 100644 --- a/src/tests/integration/basic.rs +++ b/src/tests/integration/basic.rs @@ -170,7 +170,7 @@ pub fn toggle_focused_pane_fullscreen () { // split-largest_terminal * 3, toggle-fullscreen * 2, ctrl-p, toggle-fullscreen * 2, ctrl-p, toggle-fullscreen * 2, ctrl-p, toggle-fullscreen * 2 and quit // (ctrl-z + ctrl-z + ctrl-z + ctrl-z + ctrl-f, ctrl-f, ctrl-p, ctrl-f, ctrl-f, ctrl-p, ctrl-f, // ctrl-f, ctrl-p, ctrl-f, ctrl-f, ctrl-q) - fake_input_output.add_terminal_input(&[26, 26, 26, 6, 6, 16, 6, 6, 16, 6, 6, 16, 6, 6, 17]); + fake_input_output.add_terminal_input(&[26, 26, 26, 5, 5, 16, 5, 5, 16, 5, 5, 16, 5, 5, 17]); let mut opts = Opt::default(); opts.max_panes = Some(4); start(Box::new(fake_input_output.clone()), opts); diff --git a/src/tests/integration/snapshots/mosaic__tests__integration__compatibility__run_bandwhich_from_fish_shell-2.snap b/src/tests/integration/snapshots/mosaic__tests__integration__compatibility__run_bandwhich_from_fish_shell-2.snap index 9c90df81..8ca0fe37 100644 --- a/src/tests/integration/snapshots/mosaic__tests__integration__compatibility__run_bandwhich_from_fish_shell-2.snap +++ b/src/tests/integration/snapshots/mosaic__tests__integration__compatibility__run_bandwhich_from_fish_shell-2.snap @@ -29,4 +29,4 @@ expression: snapshot │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ Press <SPACE> to pause. Use <TAB> to rearrange tables. (DNS queries hidden). -Bye from Mosaic!█ +Bye from Mosaic! diff --git a/src/tests/integration/snapshots/mosaic__tests__integration__compatibility__run_bandwhich_from_fish_shell.snap b/src/tests/integration/snapshots/mosaic__tests__integration__compatibility__run_bandwhich_from_fish_shell.snap index f8f4a539..5d056ac2 100644 --- a/src/tests/integration/snapshots/mosaic__tests__integration__compatibility__run_bandwhich_from_fish_shell.snap +++ b/src/tests/integration/snapshots/mosaic__tests__integration__compatibility__run_bandwhich_from_fish_shell.snap @@ -6,7 +6,7 @@ expression: snapshot ┌Utilization by process name───────────────────────────────────────────────────────────────────────────────────────┐ │Process Connections Up / Down │ │ │ -│firefox 3 46Bps / 5█Bps │ +│firefox 3 46Bps / 57Bps │ │ │ │ │ │ │ diff --git a/src/tests/utils.rs b/src/tests/utils.rs index 1e76b31f..779c72a4 100644 --- a/src/tests/utils.rs +++ b/src/tests/utils.rs @@ -14,15 +14,17 @@ pub fn get_output_frame_snapshots(output_frames: &[Vec<u8>], win_size: &Winsize) vte_parser.advance(&mut terminal_output, *byte); } let output_lines = terminal_output.read_buffer_as_lines(); - let (cursor_x, cursor_y) = terminal_output.cursor_coordinates(); + let cursor_coordinates = terminal_output.cursor_coordinates(); let mut snapshot = String::new(); for (line_index, line) in output_lines.iter().enumerate() { for (character_index, terminal_character) in line.iter().enumerate() { - if line_index == cursor_y && character_index == cursor_x { - snapshot.push('█'); - } else { - snapshot.push(terminal_character.character); + if let Some((cursor_x, cursor_y)) = cursor_coordinates { + if line_index == cursor_y && character_index == cursor_x { + snapshot.push('█'); + continue; + } } + snapshot.push(terminal_character.character); } if line_index != output_lines.len() - 1 { snapshot.push('\n'); |
