File tree 1 file changed +6
-9
lines changed
bridge/src/test/scala/protocbridge/frontend
1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 1
1
package protocbridge .frontend
2
2
3
+ import org .apache .commons .io .IOUtils
3
4
import org .scalatest .flatspec .AnyFlatSpec
4
5
import org .scalatest .matchers .must .Matchers
5
6
import protocbridge .{ExtraEnv , ProtocCodeGenerator }
@@ -30,17 +31,13 @@ class OsSpecificFrontendSpec extends AnyFlatSpec with Matchers {
30
31
writeInput.close()
31
32
},
32
33
processOutput => {
33
- val buffer = new Array [Byte ](4096 )
34
- var bytesRead = 0
35
- while (bytesRead != - 1 ) {
36
- bytesRead = processOutput.read(buffer)
37
- if (bytesRead != - 1 ) {
38
- actualOutput.write(buffer, 0 , bytesRead)
39
- }
40
- }
34
+ IOUtils .copy(processOutput, actualOutput)
41
35
processOutput.close()
42
36
},
43
- _.close()
37
+ processError => {
38
+ IOUtils .copy(processError, System .err)
39
+ processError.close()
40
+ }
44
41
)
45
42
)
46
43
process.exitValue()
You can’t perform that action at this time.
0 commit comments