From 7d3c64ffd2a21b82ec3b40834af090bb6523ce9b Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 6 Aug 2023 19:59:57 -0400 Subject: also fix up the test output checks --- tests/fds.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/fds.rs b/tests/fds.rs index 61fd472..a072261 100644 --- a/tests/fds.rs +++ b/tests/fds.rs @@ -3,6 +3,9 @@ mod helpers; #[test] fn test_fds() { let fds = check_open_fds(None); + let fds_strings: Vec = + fds.iter().map(std::string::ToString::to_string).collect(); + let expected_output = format!("{}\r\n", fds_strings.join("")); let pty = pty_process::blocking::Pty::new().unwrap(); let pts = pty.pts().unwrap(); @@ -13,7 +16,7 @@ fn test_fds() { .unwrap(); let mut output = helpers::output(&pty); - assert_eq!(output.next().unwrap(), "012\r\n"); + assert_eq!(output.next().unwrap(), expected_output); let status = child.wait().unwrap(); assert_eq!(status.code().unwrap(), 0); @@ -31,7 +34,7 @@ fn test_fds() { .unwrap(); let mut output = helpers::output(&pty); - assert_eq!(output.next().unwrap(), "012\r\n"); + assert_eq!(output.next().unwrap(), expected_output); let status = child.wait().unwrap(); assert_eq!(status.code().unwrap(), 0); -- cgit v1.2.3-54-g00ecf