diff options
| author | Aram Drevekenin <aram@poor.dev> | 2021-10-27 19:20:43 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-27 19:20:43 +0200 |
| commit | 21e5ffdfd8dce7b2cd1a2a74e948e8e071d22161 (patch) | |
| tree | 7f3da35f3f3960edd90ee880c618b1770d233f12 /zellij-client/src/unit/input_handler_tests.rs | |
| parent | chore(docs): update changelog (diff) | |
| download | sl0ppij-21e5ffdfd8dce7b2cd1a2a74e948e8e071d22161.tar.gz sl0ppij-21e5ffdfd8dce7b2cd1a2a74e948e8e071d22161.tar.xz sl0ppij-21e5ffdfd8dce7b2cd1a2a74e948e8e071d22161.zip | |
fix(input): properly handle bracketed paste (#810)
* fix(input): properly handle bracketed paste
* style(fmt): make rustfmt happy
Diffstat (limited to 'zellij-client/src/unit/input_handler_tests.rs')
| -rw-r--r-- | zellij-client/src/unit/input_handler_tests.rs | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/zellij-client/src/unit/input_handler_tests.rs b/zellij-client/src/unit/input_handler_tests.rs index f4beb53a..881c7f63 100644 --- a/zellij-client/src/unit/input_handler_tests.rs +++ b/zellij-client/src/unit/input_handler_tests.rs @@ -250,67 +250,3 @@ pub fn move_focus_left_in_normal_mode() { "All actions sent to server properly" ); } - -#[test] -pub fn bracketed_paste() { - let stdin_events = vec![ - ( - commands::BRACKETED_PASTE_START.to_vec(), - Event::Unsupported(commands::BRACKETED_PASTE_START.to_vec()), - ), - ( - commands::MOVE_FOCUS_LEFT_IN_NORMAL_MODE.to_vec(), - Event::Key(Key::Alt('h')), - ), - ( - commands::BRACKETED_PASTE_END.to_vec(), - Event::Unsupported(commands::BRACKETED_PASTE_END.to_vec()), - ), - (commands::QUIT.to_vec(), Event::Key(Key::Ctrl('q'))), - ]; - let events_sent_to_server = Arc::new(Mutex::new(vec![])); - let command_is_executing = CommandIsExecuting::new(); - let client_os_api = Box::new(FakeClientOsApi::new( - events_sent_to_server.clone(), - command_is_executing.clone(), - )); - let config = Config::from_default_assets().unwrap(); - let options = Options::default(); - - let (send_client_instructions, _receive_client_instructions): ChannelWithContext< - ClientInstruction, - > = channels::bounded(50); - let send_client_instructions = SenderWithContext::new(send_client_instructions); - - let (send_input_instructions, receive_input_instructions): ChannelWithContext< - InputInstruction, - > = channels::bounded(50); - let send_input_instructions = SenderWithContext::new(send_input_instructions); - for event in stdin_events { - send_input_instructions - .send(InputInstruction::KeyEvent(event.1, event.0)) - .unwrap(); - } - - let default_mode = InputMode::Normal; - input_loop( - client_os_api, - config, - options, - command_is_executing, - send_client_instructions, - default_mode, - receive_input_instructions, - ); - let expected_actions_sent_to_server = vec![ - Action::Write(commands::BRACKETED_PASTE_START.to_vec()), - Action::Write(commands::MOVE_FOCUS_LEFT_IN_NORMAL_MODE.to_vec()), // keys were directly written to server and not interpreted - Action::Write(commands::BRACKETED_PASTE_END.to_vec()), - Action::Quit, - ]; - let received_actions = extract_actions_sent_to_server(events_sent_to_server); - assert_eq!( - expected_actions_sent_to_server, received_actions, - "All actions sent to server properly" - ); -} |
