aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/integration/basic.rs
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2021-05-12 15:36:50 +0200
committera-kenji <aks.kenji@protonmail.com>2021-05-12 15:36:50 +0200
commitdb592cc840edb70239b81c72b9e87712d493bf4d (patch)
tree53533d8553d760b6510d54bbdd80b900346ff987 /src/tests/integration/basic.rs
parentFix Simplified Ui (diff)
parentdocs(changelog): pasted text fix (diff)
downloadsl0ppij-db592cc840edb70239b81c72b9e87712d493bf4d.tar.gz
sl0ppij-db592cc840edb70239b81c72b9e87712d493bf4d.tar.xz
sl0ppij-db592cc840edb70239b81c72b9e87712d493bf4d.zip
Merge branch 'main' of https://github.com/zellij-org/zellij into fix-simplified-ui
Diffstat (limited to 'src/tests/integration/basic.rs')
-rw-r--r--src/tests/integration/basic.rs49
1 files changed, 45 insertions, 4 deletions
diff --git a/src/tests/integration/basic.rs b/src/tests/integration/basic.rs
index 4d2c4878..1ebcb922 100644
--- a/src/tests/integration/basic.rs
+++ b/src/tests/integration/basic.rs
@@ -4,10 +4,10 @@ use ::insta::assert_snapshot;
use crate::common::input::{config::Config, options::Options};
use crate::tests::fakes::FakeInputOutput;
use crate::tests::utils::commands::{
- PANE_MODE, QUIT, SCROLL_DOWN_IN_SCROLL_MODE, SCROLL_MODE, SCROLL_PAGE_DOWN_IN_SCROLL_MODE,
- SCROLL_PAGE_UP_IN_SCROLL_MODE, SCROLL_UP_IN_SCROLL_MODE, SPAWN_TERMINAL_IN_PANE_MODE,
- SPLIT_DOWN_IN_PANE_MODE, SPLIT_RIGHT_IN_PANE_MODE,
- TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE,
+ BRACKETED_PASTE_END, BRACKETED_PASTE_START, PANE_MODE, QUIT, SCROLL_DOWN_IN_SCROLL_MODE,
+ SCROLL_MODE, SCROLL_PAGE_DOWN_IN_SCROLL_MODE, SCROLL_PAGE_UP_IN_SCROLL_MODE,
+ SCROLL_UP_IN_SCROLL_MODE, SPAWN_TERMINAL_IN_PANE_MODE, SPLIT_DOWN_IN_PANE_MODE,
+ SPLIT_RIGHT_IN_PANE_MODE, TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE,
};
use crate::tests::utils::{get_next_to_last_snapshot, get_output_frame_snapshots};
use crate::{start, CliArgs};
@@ -454,3 +454,44 @@ pub fn toggle_focused_pane_fullscreen() {
get_next_to_last_snapshot(snapshots).expect("could not find snapshot");
assert_snapshot!(snapshot_before_quit);
}
+
+#[test]
+pub fn bracketed_paste() {
+ // bracketed paste (https://xfree86.org/current/ctlseqs.html#Bracketed%20Paste%20Mode)
+ // makes sure that text the user pastes is not interpreted as commands by the running program
+ // (zellij in this case)
+ // this tests makes sure the "SPLIT_RIGHT_IN_PANE_MODE" command is not interpreted as Zellij,
+ // since it's inside a bracketed paste block, while the "QUIT" command is, since it is already
+ // past the block
+ let fake_win_size = PositionAndSize {
+ columns: 121,
+ rows: 20,
+ x: 0,
+ y: 0,
+ ..Default::default()
+ };
+ let mut fake_input_output = get_fake_os_input(&fake_win_size);
+ fake_input_output.add_terminal_input(&[
+ &PANE_MODE,
+ &BRACKETED_PASTE_START,
+ &SPLIT_RIGHT_IN_PANE_MODE,
+ &BRACKETED_PASTE_END,
+ &QUIT,
+ ]);
+ start(
+ Box::new(fake_input_output.clone()),
+ CliArgs::default(),
+ Box::new(fake_input_output.clone()),
+ Config::default(),
+ Options::default(),
+ );
+ let output_frames = fake_input_output
+ .stdout_writer
+ .output_frames
+ .lock()
+ .unwrap();
+ let snapshots = get_output_frame_snapshots(&output_frames, &fake_win_size);
+ let snapshot_before_quit =
+ get_next_to_last_snapshot(snapshots).expect("could not find snapshot");
+ assert_snapshot!(snapshot_before_quit);
+}