diff options
Diffstat (limited to 'zellij-client/src/unit/stdin_tests.rs')
-rw-r--r-- | zellij-client/src/unit/stdin_tests.rs | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/zellij-client/src/unit/stdin_tests.rs b/zellij-client/src/unit/stdin_tests.rs index c55283964..6bdd489bc 100644 --- a/zellij-client/src/unit/stdin_tests.rs +++ b/zellij-client/src/unit/stdin_tests.rs @@ -317,98 +317,3 @@ pub fn move_focus_left_in_normal_mode() { "All actions sent to server properly" ); } - -#[test] -pub fn terminal_info_queried_from_terminal_emulator() { - let events_sent_to_server = Arc::new(Mutex::new(vec![])); - let command_is_executing = CommandIsExecuting::new(); - let client_os_api = FakeClientOsApi::new(events_sent_to_server, command_is_executing); - - let client_os_api_clone = client_os_api.clone(); - let (send_input_instructions, _receive_input_instructions): ChannelWithContext< - InputInstruction, - > = channels::bounded(50); - let send_input_instructions = SenderWithContext::new(send_input_instructions); - let stdin_ansi_parser = Arc::new(Mutex::new(StdinAnsiParser::new())); - - let stdin_thread = thread::Builder::new() - .name("stdin_handler".to_string()) - .spawn({ - move || { - stdin_loop( - Box::new(client_os_api), - send_input_instructions, - stdin_ansi_parser, - ) - } - }); - std::thread::sleep(std::time::Duration::from_millis(500)); // wait for initial query to be sent - - let extracted_stdout_buffer = client_os_api_clone.stdout_buffer(); - let mut expected_query = - String::from("\u{1b}[14t\u{1b}[16t\u{1b}]11;?\u{1b}\u{5c}\u{1b}]10;?\u{1b}\u{5c}"); - for i in 0..256 { - expected_query.push_str(&format!("\u{1b}]4;{};?\u{1b}\u{5c}", i)); - } - assert_eq!( - String::from_utf8(extracted_stdout_buffer), - Ok(expected_query), - ); - drop(stdin_thread); -} - -#[test] -pub fn pixel_info_sent_to_server() { - let fake_stdin_buffer = read_fixture("terminal_emulator_startup_response"); - let events_sent_to_server = Arc::new(Mutex::new(vec![])); - let command_is_executing = CommandIsExecuting::new(); - let client_os_api = - FakeClientOsApi::new(events_sent_to_server.clone(), command_is_executing.clone()) - .with_stdin_buffer(fake_stdin_buffer); - 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); - let stdin_ansi_parser = Arc::new(Mutex::new(StdinAnsiParser::new())); - let stdin_thread = thread::Builder::new() - .name("stdin_handler".to_string()) - .spawn({ - let client_os_api = client_os_api.clone(); - move || { - stdin_loop( - Box::new(client_os_api), - send_input_instructions, - stdin_ansi_parser, - ) - } - }); - - let default_mode = InputMode::Normal; - let input_thread = thread::Builder::new() - .name("input_handler".to_string()) - .spawn({ - move || { - input_loop( - Box::new(client_os_api), - config, - options, - command_is_executing, - send_client_instructions, - default_mode, - receive_input_instructions, - ) - } - }); - std::thread::sleep(std::time::Duration::from_millis(1000)); // wait for initial query to be sent - assert_snapshot!(*format!("{:?}", events_sent_to_server.lock().unwrap())); - drop(stdin_thread); - drop(input_thread); -} |