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:
+6
-3
@@ -244,10 +244,13 @@ class SourceSectionsTest : TestCaseWithTmpdir() {
|
|||||||
private fun verifyScriptOutput(scriptClass: Class<*>?, expectedOutput: File) {
|
private fun verifyScriptOutput(scriptClass: Class<*>?, expectedOutput: File) {
|
||||||
val scriptOut = captureOut {
|
val scriptOut = captureOut {
|
||||||
tryConstructClassFromStringArgs(scriptClass!!, emptyList())
|
tryConstructClassFromStringArgs(scriptClass!!, emptyList())
|
||||||
}.first
|
}.first.lines()
|
||||||
val expected = expectedOutput.readText()
|
.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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user