Gradle, tests runner, output stream handler: don't treat flush as new line
#KT-31931 Fixed
This commit is contained in:
+1
-5
@@ -33,7 +33,7 @@ internal class TCServiceMessageOutputStreamHandler(
|
||||
@Throws(IOException::class)
|
||||
override fun close() {
|
||||
closed = true
|
||||
flush()
|
||||
flushLine()
|
||||
}
|
||||
|
||||
override fun write(b: ByteArray, off: Int, len: Int) {
|
||||
@@ -77,10 +77,6 @@ internal class TCServiceMessageOutputStreamHandler(
|
||||
}
|
||||
}
|
||||
|
||||
override fun flush() {
|
||||
flushLine()
|
||||
}
|
||||
|
||||
private fun overflow() {
|
||||
val text = buffer.toString("utf-8")
|
||||
|
||||
|
||||
+18
@@ -64,6 +64,24 @@ class TCServiceMessageOutputStreamHandlerTest {
|
||||
assertEquals("[]", logString)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testFlush() {
|
||||
handler.write("xxx##teamc".toByteArray())
|
||||
handler.flush()
|
||||
handler.write("ity[testStarted]\n".toByteArray())
|
||||
handler.write("yyy##teamcity[testStarted]".toByteArray())
|
||||
handler.close()
|
||||
assertEquals(
|
||||
"TEXT: `xxx`\n" +
|
||||
"MESSAGE: `##teamcity[testStarted]`\n" +
|
||||
"TEXT: `\n`\n" + // this will be ignore in org.jetbrains.kotlin.gradle.internal.testing.TCServiceMessagesClient.regularText
|
||||
"TEXT: `yyy`\n" +
|
||||
"MESSAGE: `##teamcity[testStarted]`\n",
|
||||
clientCalls
|
||||
)
|
||||
assertEquals("[]", logString)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testMessage() {
|
||||
handler.write("xxx##teamcity[testStarted]\n".toByteArray())
|
||||
|
||||
Reference in New Issue
Block a user