aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/integration/resize_right.rs
diff options
context:
space:
mode:
authorDenis Maximov <denismaximov98@gmail.com>2020-11-14 19:59:37 +0200
committerGitHub <noreply@github.com>2020-11-14 18:59:37 +0100
commita2914066bf0e2e2bf5caee263d2378b7d77f477f (patch)
tree2a87397c32e2d9f512ad0c886107aa5c2e57d68e /src/tests/integration/resize_right.rs
parentHOTFIX: do not get os input unless we're starting the app (diff)
downloadsl0ppij-a2914066bf0e2e2bf5caee263d2378b7d77f477f.tar.gz
sl0ppij-a2914066bf0e2e2bf5caee263d2378b7d77f477f.tar.xz
sl0ppij-a2914066bf0e2e2bf5caee263d2378b7d77f477f.zip
feat: add rustfmt, update action workflow to check for formatting (#45)
Diffstat (limited to 'src/tests/integration/resize_right.rs')
-rw-r--r--src/tests/integration/resize_right.rs102
1 files changed, 68 insertions, 34 deletions
diff --git a/src/tests/integration/resize_right.rs b/src/tests/integration/resize_right.rs
index ee809b41..b2201591 100644
--- a/src/tests/integration/resize_right.rs
+++ b/src/tests/integration/resize_right.rs
@@ -1,20 +1,15 @@
-use ::nix::pty::Winsize;
use ::insta::assert_snapshot;
+use ::nix::pty::Winsize;
-use crate::{start, Opt};
-use crate::tests::fakes::{FakeInputOutput};
+use crate::tests::fakes::FakeInputOutput;
use crate::tests::utils::get_output_frame_snapshots;
+use crate::{start, Opt};
use crate::tests::utils::commands::{
- SPLIT_HORIZONTALLY,
- SPLIT_VERTICALLY,
- RESIZE_UP,
- MOVE_FOCUS,
- RESIZE_RIGHT,
- QUIT,
+ MOVE_FOCUS, QUIT, RESIZE_RIGHT, RESIZE_UP, SPLIT_HORIZONTALLY, SPLIT_VERTICALLY,
};
-fn get_fake_os_input (fake_win_size: &Winsize) -> FakeInputOutput {
+fn get_fake_os_input(fake_win_size: &Winsize) -> FakeInputOutput {
FakeInputOutput::new(fake_win_size.clone())
}
@@ -33,14 +28,14 @@ pub fn resize_right_with_pane_to_the_left() {
ws_ypixel: 0,
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
- fake_input_output.add_terminal_input(&[
- SPLIT_VERTICALLY,
- RESIZE_RIGHT,
- QUIT,
- ]);
+ fake_input_output.add_terminal_input(&[SPLIT_VERTICALLY, RESIZE_RIGHT, QUIT]);
start(Box::new(fake_input_output.clone()), Opt::default());
- let output_frames = fake_input_output.stdout_writer.output_frames.lock().unwrap();
+ let output_frames = fake_input_output
+ .stdout_writer
+ .output_frames
+ .lock()
+ .unwrap();
let snapshots = get_output_frame_snapshots(&output_frames, &fake_win_size);
for snapshot in snapshots {
assert_snapshot!(snapshot);
@@ -62,15 +57,14 @@ pub fn resize_right_with_pane_to_the_right() {
ws_ypixel: 0,
};
let mut fake_input_output = get_fake_os_input(&fake_win_size);
- fake_input_output.add_terminal_input(&[
- SPLIT_VERTICALLY,
- MOVE_FOCUS,
- RESIZE_RIGHT,
- QUIT,
- ]);
+ fake_input_output.add_terminal_input(&[SPLIT_VERTICALLY, MOVE_FOCUS, RESIZE_RIGHT, QUIT]);
start(Box::new(fake_input_output.clone()), Opt::default());
- let output_frames = fake_input_output.stdout_writer.output_frames.lock().unwrap();
+ let output_frames = fake_input_output
+ .stdout_writer
+ .output_frames
+ .lock()
+ .unwrap();
let snapshots = get_output_frame_snapshots(&output_frames, &fake_win_size);
for snapshot in snapshots {
assert_snapshot!(snapshot);
@@ -102,7 +96,11 @@ pub fn resize_right_with_panes_to_the_left_and_right() {
]);
start(Box::new(fake_input_output.clone()), Opt::default());
- let output_frames = fake_input_output.stdout_writer.output_frames.lock().unwrap();
+ let output_frames = fake_input_output
+ .stdout_writer
+ .output_frames
+ .lock()
+ .unwrap();
let snapshots = get_output_frame_snapshots(&output_frames, &fake_win_size);
for snapshot in snapshots {
assert_snapshot!(snapshot);
@@ -137,7 +135,11 @@ pub fn resize_right_with_multiple_panes_to_the_left() {
start(Box::new(fake_input_output.clone()), Opt::default());
- let output_frames = fake_input_output.stdout_writer.output_frames.lock().unwrap();
+ let output_frames = fake_input_output
+ .stdout_writer
+ .output_frames
+ .lock()
+ .unwrap();
let snapshots = get_output_frame_snapshots(&output_frames, &fake_win_size);
for snapshot in snapshots {
assert_snapshot!(snapshot);
@@ -174,7 +176,11 @@ pub fn resize_right_with_panes_to_the_left_aligned_top_with_current_pane() {
start(Box::new(fake_input_output.clone()), Opt::default());
- let output_frames = fake_input_output.stdout_writer.output_frames.lock().unwrap();
+ let output_frames = fake_input_output
+ .stdout_writer
+ .output_frames
+ .lock()
+ .unwrap();
let snapshots = get_output_frame_snapshots(&output_frames, &fake_win_size);
for snapshot in snapshots {
assert_snapshot!(snapshot);
@@ -208,7 +214,11 @@ pub fn resize_right_with_panes_to_the_right_aligned_top_with_current_pane() {
start(Box::new(fake_input_output.clone()), Opt::default());
- let output_frames = fake_input_output.stdout_writer.output_frames.lock().unwrap();
+ let output_frames = fake_input_output
+ .stdout_writer
+ .output_frames
+ .lock()
+ .unwrap();
let snapshots = get_output_frame_snapshots(&output_frames, &fake_win_size);
for snapshot in snapshots {
assert_snapshot!(snapshot);
@@ -244,7 +254,11 @@ pub fn resize_right_with_panes_to_the_left_aligned_bottom_with_current_pane() {
start(Box::new(fake_input_output.clone()), Opt::default());
- let output_frames = fake_input_output.stdout_writer.output_frames.lock().unwrap();
+ let output_frames = fake_input_output
+ .stdout_writer
+ .output_frames
+ .lock()
+ .unwrap();
let snapshots = get_output_frame_snapshots(&output_frames, &fake_win_size);
for snapshot in snapshots {
assert_snapshot!(snapshot);
@@ -279,7 +293,11 @@ pub fn resize_right_with_panes_to_the_right_aligned_bottom_with_current_pane() {
start(Box::new(fake_input_output.clone()), Opt::default());
- let output_frames = fake_input_output.stdout_writer.output_frames.lock().unwrap();
+ let output_frames = fake_input_output
+ .stdout_writer
+ .output_frames
+ .lock()
+ .unwrap();
let snapshots = get_output_frame_snapshots(&output_frames, &fake_win_size);
for snapshot in snapshots {
assert_snapshot!(snapshot);
@@ -314,12 +332,16 @@ pub fn resize_right_with_panes_to_the_left_aligned_top_and_bottom_with_current_p
MOVE_FOCUS,
SPLIT_VERTICALLY,
RESIZE_RIGHT,
- QUIT
+ QUIT,
]);
start(Box::new(fake_input_output.clone()), Opt::default());
- let output_frames = fake_input_output.stdout_writer.output_frames.lock().unwrap();
+ let output_frames = fake_input_output
+ .stdout_writer
+ .output_frames
+ .lock()
+ .unwrap();
let snapshots = get_output_frame_snapshots(&output_frames, &fake_win_size);
for snapshot in snapshots {
assert_snapshot!(snapshot);
@@ -361,7 +383,11 @@ pub fn resize_right_with_panes_to_the_right_aligned_top_and_bottom_with_current_
start(Box::new(fake_input_output.clone()), Opt::default());
- let output_frames = fake_input_output.stdout_writer.output_frames.lock().unwrap();
+ let output_frames = fake_input_output
+ .stdout_writer
+ .output_frames
+ .lock()
+ .unwrap();
let snapshots = get_output_frame_snapshots(&output_frames, &fake_win_size);
for snapshot in snapshots {
assert_snapshot!(snapshot);
@@ -418,7 +444,11 @@ pub fn resize_right_with_panes_to_the_left_aligned_top_and_bottom_with_panes_abo
start(Box::new(fake_input_output.clone()), Opt::default());
- let output_frames = fake_input_output.stdout_writer.output_frames.lock().unwrap();
+ let output_frames = fake_input_output
+ .stdout_writer
+ .output_frames
+ .lock()
+ .unwrap();
let snapshots = get_output_frame_snapshots(&output_frames, &fake_win_size);
for snapshot in snapshots {
assert_snapshot!(snapshot);
@@ -477,7 +507,11 @@ pub fn resize_right_with_panes_to_the_right_aligned_top_and_bottom_with_panes_ab
start(Box::new(fake_input_output.clone()), Opt::default());
- let output_frames = fake_input_output.stdout_writer.output_frames.lock().unwrap();
+ let output_frames = fake_input_output
+ .stdout_writer
+ .output_frames
+ .lock()
+ .unwrap();
let snapshots = get_output_frame_snapshots(&output_frames, &fake_win_size);
for snapshot in snapshots {
assert_snapshot!(snapshot);