mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
tests/util: Improve UChild. Cleanup redundant functions in util.rs.
A short summary of changes: * Add some basic tests for UChild and the run methods. * Try more often in a fixed interval to create the tempfile for CapturedOutput. * Fix drop order of struct fields for better cleanup of temporary files/dirs. * Mark UChild::wait_with_output and UChild::pipe_in_and_wait_with_output deprecated * Make CapturedOutput private * Panic in stdout_all, stdout_all_bytes etc. if output is not captured. * Rename some methods, refactor, clean up, fix documentation, add try_... methods
This commit is contained in:
parent
982fb682e9
commit
4f54eedb74
5 changed files with 549 additions and 278 deletions
|
@ -21,6 +21,8 @@ fn run(args: &[&str], expected: &[u8]) {
|
|||
let mut child = cmd.args(args).set_stdout(Stdio::piped()).run_no_wait();
|
||||
let buf = child.stdout_exact_bytes(expected.len());
|
||||
child.close_stdout();
|
||||
|
||||
#[allow(deprecated)]
|
||||
check_termination(&child.wait_with_output().unwrap().status);
|
||||
assert_eq!(buf.as_slice(), expected);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue