Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip
Browse files Browse the repository at this point in the history
doy committed Jan 29, 2025
1 parent d51e14f commit 95a744a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/basic.rs
Original file line number Diff line number Diff line change
@@ -17,6 +17,8 @@ fn test_cat_blocking() {
assert_eq!(output.next().unwrap(), "foo\r\n");

pty.write_all(&[4u8]).unwrap();
drop(pts);
drop(pty);
let status = child.wait().unwrap();
assert_eq!(status.code().unwrap(), 0);
}
@@ -40,6 +42,7 @@ async fn test_cat_async() {
assert_eq!(output.next().await.unwrap(), "foo\r\n");

pty_w.write_all(&[4u8]).await.unwrap();
drop(pts);
let status = child.wait().await.unwrap();
assert_eq!(status.code().unwrap(), 0);
}
@@ -58,13 +61,15 @@ async fn test_yes_async() {
let bytes = pty.read_buf(&mut &mut buf[..]).await.unwrap();
assert_eq!(&buf[..bytes], b"y\r\n");

let (mut pty_r, _pty_w) = pty.split();
let (mut pty_r, _) = pty.split();
let bytes = pty_r.read_buf(&mut &mut buf[..]).await.unwrap();
assert_eq!(&buf[..bytes], b"y\r\n");

let (mut pty_r, _pty_w) = pty.into_split();
let (mut pty_r, _) = pty.into_split();
let bytes = pty_r.read_buf(&mut &mut buf[..]).await.unwrap();
assert_eq!(&buf[..bytes], b"y\r\n");

child.kill().await.unwrap()
drop(pts);
drop(pty_r);
child.kill().await.unwrap();
}

0 comments on commit 95a744a

Please sign in to comment.