Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
doy committed Dec 3, 2023
1 parent 38d05cf commit a7495c7
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions tests/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ async fn test_split() {
use tokio::io::AsyncWriteExt as _;

let mut pty = pty_process::Pty::new().unwrap();
let pts = pty.pts().unwrap();
pty.resize(pty_process::Size::new(24, 80)).unwrap();
let mut cmd = pty_process::Command::new("perl");
cmd.args(["-plE", "BEGIN { $SIG{WINCH} = sub { say 'WINCH' } }"]);
let mut child = cmd.spawn(&pts).unwrap();
let mut child = {
let pts = pty.pts().unwrap();
pty.resize(pty_process::Size::new(24, 80)).unwrap();
let mut cmd = pty_process::Command::new("perl");
cmd.args(["-plE", "BEGIN { $SIG{WINCH} = sub { say 'WINCH' } }"]);
cmd.spawn(&pts).unwrap()
};

{
pty.write_all(b"foo\n").await.unwrap();
Expand Down Expand Up @@ -46,11 +48,13 @@ async fn test_into_split() {
use tokio::io::{AsyncBufReadExt as _, AsyncWriteExt as _};

let mut pty = pty_process::Pty::new().unwrap();
let pts = pty.pts().unwrap();
pty.resize(pty_process::Size::new(24, 80)).unwrap();
let mut cmd = pty_process::Command::new("perl");
cmd.args(["-plE", "BEGIN { $SIG{WINCH} = sub { say 'WINCH' } }"]);
let mut child = cmd.spawn(&pts).unwrap();
let mut child = {
let pts = pty.pts().unwrap();
pty.resize(pty_process::Size::new(24, 80)).unwrap();
let mut cmd = pty_process::Command::new("perl");
cmd.args(["-plE", "BEGIN { $SIG{WINCH} = sub { say 'WINCH' } }"]);
cmd.spawn(&pts).unwrap()
};

{
pty.write_all(b"foo\n").await.unwrap();
Expand Down

0 comments on commit a7495c7

Please sign in to comment.