From 5745752841b1bc07b8156e34715e7126fc5b4353 Mon Sep 17 00:00:00 2001 From: Ilya Chernikov Date: Tue, 2 May 2017 22:19:10 +0200 Subject: [PATCH] Ignore empty lines at the end of the testdata, more tests should finally fix source-section plugin tests on windows --- .../kotlin/sourceSections/SourceSectionsTest.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/source-sections/source-sections-compiler/tests/org/jetbrains/kotlin/sourceSections/SourceSectionsTest.kt b/plugins/source-sections/source-sections-compiler/tests/org/jetbrains/kotlin/sourceSections/SourceSectionsTest.kt index 2ccaeec82da..c0294d3430b 100644 --- a/plugins/source-sections/source-sections-compiler/tests/org/jetbrains/kotlin/sourceSections/SourceSectionsTest.kt +++ b/plugins/source-sections/source-sections-compiler/tests/org/jetbrains/kotlin/sourceSections/SourceSectionsTest.kt @@ -244,10 +244,13 @@ class SourceSectionsTest : TestCaseWithTmpdir() { private fun verifyScriptOutput(scriptClass: Class<*>?, expectedOutput: File) { val scriptOut = captureOut { tryConstructClassFromStringArgs(scriptClass!!, emptyList()) - }.first - val expected = expectedOutput.readText() + }.first.lines() + .map(String::trimEnd) + .dropLastWhile { it.isBlank() } - TestCase.assertEquals(expected, scriptOut) + val expected = expectedOutput.inputStream().trimmedLines(Charset.defaultCharset()) + + TestCase.assertEquals("Unexpected result on evaluating ${scriptClass?.name}", expected, scriptOut) } }