1
Fork 0
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:
Joining7943 2022-11-23 06:43:02 +01:00
parent 982fb682e9
commit 4f54eedb74
5 changed files with 549 additions and 278 deletions

View file

@ -131,6 +131,8 @@ mod linux_only {
fn run_tee(proc: &mut UCommand) -> (String, Output) {
let content = (1..=100000).map(|x| format!("{}\n", x)).collect::<String>();
#[allow(deprecated)]
let output = proc
.run_no_wait()
.pipe_in_and_wait_with_output(content.as_bytes());