Ignore empty lines at the end of the testdata, remove debug dump

should fix source-section plugin tests on windows
This commit is contained in:
Ilya Chernikov
2017-04-18 17:30:35 +02:00
parent fd41e266fb
commit af4caeaf24
2 changed files with 4 additions and 9 deletions
@@ -41,14 +41,7 @@ class FilteredSectionsVirtualFile(val delegate: VirtualFile, val sectionIds: Col
override fun getTimeStamp(): Long = delegate.timeStamp
override fun getName(): String = delegate.name
override fun contentsToByteArray(): ByteArray {
val res = filterByteContents(sectionIds, delegate.contentsToByteArray(), delegate.charset)
val dbgDumpFile = delegate.canonicalPath?.let { java.io.File(it + ".${sectionIds.joinToString(".")}.dump") }
if (dbgDumpFile != null && !dbgDumpFile.exists()) {
dbgDumpFile.writeText(String(res))
}
return res
}
override fun contentsToByteArray(): ByteArray = filterByteContents(sectionIds, delegate.contentsToByteArray(), delegate.charset)
override fun getInputStream(): InputStream = ByteArrayInputStream(contentsToByteArray())