diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/tests/e2e/cases.rs | 86 | ||||
-rw-r--r-- | src/tests/e2e/remote_runner.rs | 6 |
2 files changed, 45 insertions, 47 deletions
diff --git a/src/tests/e2e/cases.rs b/src/tests/e2e/cases.rs index dda7d96a8..307986c1a 100644 --- a/src/tests/e2e/cases.rs +++ b/src/tests/e2e/cases.rs @@ -157,7 +157,7 @@ pub fn cannot_split_terminals_vertically_when_active_terminal_is_too_small() { instruction: |mut remote_terminal: RemoteTerminal| -> bool { // this is just normal input that should be sent into the one terminal so that we can make // sure we silently failed to split in the previous step - remote_terminal.send_key(&"Hi!".as_bytes()); + remote_terminal.send_key("Hi!".as_bytes()); true }, }) @@ -205,26 +205,26 @@ pub fn scrolling_inside_a_pane() { let mut step_is_complete = false; if remote_terminal.cursor_position_is(63, 2) && remote_terminal.tip_appears() { // cursor is in the newly opened second pane - remote_terminal.send_key(&format!("{:0<56}", "line1 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line2 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line3 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line4 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line5 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line6 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line7 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line8 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line9 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line10 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line11 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line12 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line13 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line14 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line15 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line16 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line17 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line18 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line19 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<57}", "line20 ").as_bytes()); + remote_terminal.send_key(format!("{:0<56}", "line1 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line2 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line3 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line4 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line5 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line6 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line7 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line8 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line9 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line10 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line11 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line12 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line13 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line14 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line15 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line16 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line17 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line18 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line19 ").as_bytes()); + remote_terminal.send_key(format!("{:0<57}", "line20 ").as_bytes()); step_is_complete = true; } step_is_complete @@ -574,7 +574,7 @@ pub fn lock_mode() { if remote_terminal.snapshot_contains("INTERFACE LOCKED") { remote_terminal.send_key(&TAB_MODE); remote_terminal.send_key(&NEW_TAB_IN_TAB_MODE); - remote_terminal.send_key(&"abc".as_bytes()); + remote_terminal.send_key("abc".as_bytes()); step_is_complete = true; } step_is_complete @@ -675,7 +675,7 @@ pub fn detach_and_attach_session() { let mut step_is_complete = false; if remote_terminal.cursor_position_is(63, 2) && remote_terminal.tip_appears() { // new pane has been opened and focused - remote_terminal.send_key(&"I am some text".as_bytes()); + remote_terminal.send_key("I am some text".as_bytes()); step_is_complete = true; } step_is_complete @@ -825,26 +825,26 @@ pub fn scrolling_inside_a_pane_with_mouse() { let mut step_is_complete = false; if remote_terminal.cursor_position_is(63, 2) && remote_terminal.tip_appears() { // cursor is in the newly opened second pane - remote_terminal.send_key(&format!("{:0<56}", "line1 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line2 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line3 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line4 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line5 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line6 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line7 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line8 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line9 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line10 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line11 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line12 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line13 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line14 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line15 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line16 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line17 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line18 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<58}", "line19 ").as_bytes()); - remote_terminal.send_key(&format!("{:0<57}", "line20 ").as_bytes()); + remote_terminal.send_key(format!("{:0<56}", "line1 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line2 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line3 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line4 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line5 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line6 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line7 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line8 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line9 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line10 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line11 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line12 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line13 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line14 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line15 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line16 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line17 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line18 ").as_bytes()); + remote_terminal.send_key(format!("{:0<58}", "line19 ").as_bytes()); + remote_terminal.send_key(format!("{:0<57}", "line20 ").as_bytes()); step_is_complete = true; } step_is_complete diff --git a/src/tests/e2e/remote_runner.rs b/src/tests/e2e/remote_runner.rs index de9c35edc..7c4587f3e 100644 --- a/src/tests/e2e/remote_runner.rs +++ b/src/tests/e2e/remote_runner.rs @@ -34,9 +34,7 @@ fn setup_remote_environment(channel: &mut ssh2::Channel, win_size: Size) { .request_pty("xterm", None, Some((columns, rows, 0, 0))) .unwrap(); channel.shell().unwrap(); - channel - .write_all(format!("export PS1=\"$ \"\n").as_bytes()) - .unwrap(); + channel.write_all("export PS1=\"$ \"\n".as_bytes()).unwrap(); channel.flush().unwrap(); } @@ -154,7 +152,7 @@ impl<'a> RemoteTerminal<'a> { format!("x: {}, y: {}", self.cursor_x, self.cursor_y) } pub fn send_key(&mut self, key: &[u8]) { - self.channel.write(key).unwrap(); + self.channel.write_all(key).unwrap(); self.channel.flush().unwrap(); } pub fn change_size(&mut self, cols: u32, rows: u32) { |