aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/integration/basic.rs
diff options
context:
space:
mode:
authordenis <denismaximov98@gmail.com>2021-01-29 06:24:59 +0200
committerdenis <denismaximov98@gmail.com>2021-01-29 06:24:59 +0200
commit6a3481f54f0ee789ceeb994d8f302e3ce119c031 (patch)
tree60d4ad8d08c2349571d29d68c357ac07c6acce63 /src/tests/integration/basic.rs
parentwip: oops shouldn't forget that (diff)
parentfeat(statusbar): max status bar height (#156) (diff)
downloadsl0ppij-6a3481f54f0ee789ceeb994d8f302e3ce119c031.tar.gz
sl0ppij-6a3481f54f0ee789ceeb994d8f302e3ce119c031.tar.xz
sl0ppij-6a3481f54f0ee789ceeb994d8f302e3ce119c031.zip
Merge branch 'main' into restructure
Diffstat (limited to 'src/tests/integration/basic.rs')
-rw-r--r--src/tests/integration/basic.rs81
1 files changed, 81 insertions, 0 deletions
diff --git a/src/tests/integration/basic.rs b/src/tests/integration/basic.rs
index 7c9d3c6a..67f66eb0 100644
--- a/src/tests/integration/basic.rs
+++ b/src/tests/integration/basic.rs
@@ -120,6 +120,87 @@ pub fn split_largest_terminal() {
}
#[test]
+pub fn cannot_split_terminals_vertically_when_active_terminal_is_too_small() {
+ let fake_win_size = PositionAndSize {
+ columns: 8,
+ rows: 20,
+ x: 0,
+ y: 0,
+ };
+ let mut fake_input_output = get_fake_os_input(&fake_win_size);
+ fake_input_output.add_terminal_input(&[
+ &COMMAND_TOGGLE,
+ &COMMAND_TOGGLE,
+ &SPLIT_VERTICALLY,
+ &QUIT,
+ ]);
+ start(Box::new(fake_input_output.clone()), CliArgs::default());
+ 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);
+ }
+}
+
+#[test]
+pub fn cannot_split_terminals_horizontally_when_active_terminal_is_too_small() {
+ let fake_win_size = PositionAndSize {
+ columns: 121,
+ rows: 4,
+ x: 0,
+ y: 0,
+ };
+ let mut fake_input_output = get_fake_os_input(&fake_win_size);
+ fake_input_output.add_terminal_input(&[
+ &COMMAND_TOGGLE,
+ &COMMAND_TOGGLE,
+ &SPLIT_HORIZONTALLY,
+ &QUIT,
+ ]);
+ start(Box::new(fake_input_output.clone()), CliArgs::default());
+ 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);
+ }
+}
+
+#[test]
+pub fn cannot_split_largest_terminal_when_there_is_no_room() {
+ let fake_win_size = PositionAndSize {
+ columns: 8,
+ rows: 4,
+ x: 0,
+ y: 0,
+ };
+ let mut fake_input_output = get_fake_os_input(&fake_win_size);
+ fake_input_output.add_terminal_input(&[
+ &COMMAND_TOGGLE,
+ &COMMAND_TOGGLE,
+ &SPAWN_TERMINAL,
+ &QUIT,
+ ]);
+ start(Box::new(fake_input_output.clone()), CliArgs::default());
+ 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);
+ }
+}
+
+#[test]
pub fn resize_right_and_up_on_the_same_axis() {
// this is a specific test to explicitly ensure that a tmux-like pane-container algorithm is not
// implemented (this test can never pass with such an algorithm)