summaryrefslogtreecommitdiff
path: root/test/test_pty.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-02-21 15:04:39 -0500
committerJesse Luehrs <doy@tozt.net>2022-02-22 13:08:54 -0500
commit22bb1056126cee98dcf747eb48fc5fb5736fe7d7 (patch)
treef208402f7ebddfbc4c33ea952de01b39fe0c141a /test/test_pty.rs
parentfc3a77b7fcf7da0d198c3c9ab9957c8c889a6fe0 (diff)
downloadnix-22bb1056126cee98dcf747eb48fc5fb5736fe7d7.zip
also implement Read and Write for &PtyMaster
Diffstat (limited to 'test/test_pty.rs')
-rw-r--r--test/test_pty.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test_pty.rs b/test/test_pty.rs
index 71932f2d..1a7cab81 100644
--- a/test/test_pty.rs
+++ b/test/test_pty.rs
@@ -170,6 +170,11 @@ fn test_read_ptty_pair() {
slave.write_all(b"hello").unwrap();
master.read_exact(&mut buf).unwrap();
assert_eq!(&buf, b"hello");
+
+ let mut master = &master;
+ slave.write_all(b"hello").unwrap();
+ master.read_exact(&mut buf).unwrap();
+ assert_eq!(&buf, b"hello");
}
/// Test `io::Write` on the PTTY master
@@ -182,6 +187,11 @@ fn test_write_ptty_pair() {
master.write_all(b"adios").unwrap();
slave.read_exact(&mut buf).unwrap();
assert_eq!(&buf, b"adios");
+
+ let mut master = &master;
+ master.write_all(b"adios").unwrap();
+ slave.read_exact(&mut buf).unwrap();
+ assert_eq!(&buf, b"adios");
}
#[test]