Ignore empty lines at the end of the testdata, more tests

should finally fix source-section plugin tests on windows
This commit is contained in:
Ilya Chernikov
2017-05-02 22:19:10 +02:00
parent 732367e671
commit 5745752841
@@ -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)
}
}