8e98deb3b0
Sometimes, the launched test process can't finish on Windows if stdout and stderr threads are not read completely. The proper approach here would be to spawn two threads for constantly reading stdout & stderr while the process in being executed.
17 lines
361 B
Kotlin
Vendored
17 lines
361 B
Kotlin
Vendored
// KIND: STANDALONE_NO_TR
|
|
|
|
import kotlin.test.assertEquals
|
|
|
|
// Prints 1_000_000 bytes to stdout and exits.
|
|
fun main() {
|
|
assertEquals(10, TEN_BYTES_STRING.length)
|
|
repeat(1000) { print1000Bytes() }
|
|
}
|
|
|
|
private fun print1000Bytes() {
|
|
// Print 1000 bytes.
|
|
repeat(100) { print(TEN_BYTES_STRING) }
|
|
}
|
|
|
|
private const val TEN_BYTES_STRING = "Hi, test!\n"
|