[AA LC Test] Cleanup resulting java dump

- Remove redundant spaces
- Add empty line at the end
This commit is contained in:
Dmitriy Novozhilov
2022-08-12 17:19:06 +03:00
parent ab2aa3117b
commit 1fd2816755
@@ -59,13 +59,21 @@ abstract class AbstractSymbolLightClassesTestBase(
val project = ktFile.project
ignoreExceptionIfIgnoreFirPresent(module) {
val actual = getRenderResult(ktFile, testDataPath, module, project)
val actual = getRenderResult(ktFile, testDataPath, module, project).cleanup()
compareResults(testServices, actual)
removeIgnoreFir(module)
removeDuplicatedFirJava(testServices)
}
}
private fun String.cleanup(): String {
val lines = this.lines().mapTo(mutableListOf()) { it.ifBlank { "" } }
if (lines.last().isNotBlank()) {
lines += ""
}
return lines.joinToString("\n")
}
protected abstract fun getRenderResult(
ktFile: KtFile,
testDataFile: Path,
@@ -149,4 +157,4 @@ abstract class AbstractSymbolLightClassesTestBase(
applicability = DirectiveApplicability.Global
)
}
}
}