diff --git a/tests/ui/src/imag.rs b/tests/ui/src/imag.rs index 094a0dfe..3c517ce2 100644 --- a/tests/ui/src/imag.rs +++ b/tests/ui/src/imag.rs @@ -42,7 +42,7 @@ pub fn binary(tempdir: &TempDir, binary_name: &str) -> Command { /// Run the passed command and get the stdout of it. /// /// This function does _not_ ensure that stdin is inherited. -pub fn stdout_of_command(command: Command) -> Vec { +pub fn stdout_of_command(mut command: Command) -> Vec { let assert = command.assert(); let lines = String::from_utf8(assert.get_output().stdout.clone()) .unwrap() diff --git a/tests/ui/src/imag_ids.rs b/tests/ui/src/imag_ids.rs index 2c38906e..f6351eb6 100644 --- a/tests/ui/src/imag_ids.rs +++ b/tests/ui/src/imag_ids.rs @@ -29,15 +29,7 @@ pub fn call(tempdir: &TempDir) -> Vec { // ensure that stdin is not used by the child process binary.stdin(std::process::Stdio::inherit()); - - let assert = binary.assert(); - let lines = String::from_utf8(assert.get_output().stdout.clone()) - .unwrap() - .lines() - .map(String::from) - .collect(); - assert.success(); - lines + crate::imag::stdout_of_command(binary) } pub fn binary(tempdir: &TempDir) -> Command {