fix(test): capture inherited stdout and stderr for subprocesses in test output (#14395)

This commit is contained in:
David Sherret 2022-04-26 14:46:49 -04:00 committed by GitHub
parent f07f246ae8
commit a1b4aa2ae6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 84 additions and 33 deletions

View file

@ -760,9 +760,8 @@ impl test::TestReporter for LspTestReporter {
.and_then(|v| v.last().map(|td| td.into()))
});
let value = match output {
test::TestOutput::PrintStdout(value)
| test::TestOutput::PrintStderr(value) => value.replace('\n', "\r\n"),
test::TestOutput::Stdout(bytes) | test::TestOutput::Stderr(bytes) => {
test::TestOutput::String(value) => value.replace('\n', "\r\n"),
test::TestOutput::Bytes(bytes) => {
String::from_utf8_lossy(bytes).replace('\n', "\r\n")
}
};