diff options
author | Jesse Luehrs <doy@tozt.net> | 2022-02-22 17:02:12 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2022-02-23 02:44:18 -0500 |
commit | 39287b07f87aba15c4cb0f64d7008ba67289151d (patch) | |
tree | a0ce5fee6e98a7c429f668000d7cdc71cf8d4797 /tests/fds.rs | |
parent | ebcf5f15081f6a84c861eb2aecbf962396a88695 (diff) | |
download | pty-process-39287b07f87aba15c4cb0f64d7008ba67289151d.tar.gz pty-process-39287b07f87aba15c4cb0f64d7008ba67289151d.zip |
another rewrite
Diffstat (limited to 'tests/fds.rs')
-rw-r--r-- | tests/fds.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/fds.rs b/tests/fds.rs index 8b64d3f..a641f46 100644 --- a/tests/fds.rs +++ b/tests/fds.rs @@ -5,10 +5,11 @@ fn test_fds() { check_open_fds(); let pty = pty_process::blocking::Pty::new().unwrap(); + let pts = pty.pts().unwrap(); pty.resize(pty_process::Size::new(24, 80)).unwrap(); let mut child = pty_process::blocking::Command::new("perl") .arg("-Efor my $fd (0..255) { open my $fh, \"<&=$fd\"; print $fd if stat $fh }; say") - .spawn(&pty) + .spawn(&pts) .unwrap(); let mut output = helpers::output(&pty); @@ -17,14 +18,16 @@ fn test_fds() { let status = child.wait().unwrap(); assert_eq!(status.code().unwrap(), 0); drop(pty); + drop(pts); check_open_fds(); let pty = pty_process::blocking::Pty::new().unwrap(); + let pts = pty.pts().unwrap(); pty.resize(pty_process::Size::new(24, 80)).unwrap(); let mut child = pty_process::blocking::Command::new("perl") .arg("-Efor my $fd (0..255) { open my $fh, \"<&=$fd\"; print $fd if stat $fh }; say") .stderr(std::process::Stdio::null()) - .spawn(&pty) + .spawn(&pts) .unwrap(); let mut output = helpers::output(&pty); @@ -33,6 +36,7 @@ fn test_fds() { let status = child.wait().unwrap(); assert_eq!(status.code().unwrap(), 0); drop(pty); + drop(pts); check_open_fds(); } |