[Analysis API] fix "KotlinIllegalStateExceptionWithAttachments: expected as maximum one expect for the actual"

^KT-61597 fixed
This commit is contained in:
Ilya Kirillov
2023-08-30 23:47:19 +02:00
committed by Space Team
parent f39153b6e6
commit 56910b70a3
13 changed files with 71 additions and 36 deletions
@@ -24,13 +24,16 @@ abstract class AbstractExpectForActualTest : AbstractAnalysisApiBasedTest() {
val expectedSymbolText: String? = executeOnPooledThreadInReadAction {
analyseForTest(declaration) {
val expectedSymbol = declaration.getSymbol().getExpectForActual() ?: return@analyseForTest null
expectedSymbol.psi?.containingFile?.name + " : " + expectedSymbol.render()
val expectedSymbols = declaration.getSymbol().getExpectsForActual()
expectedSymbols.joinToString(separator = "\n") { expectedSymbol ->
expectedSymbol.psi?.containingFile?.name + " : " + expectedSymbol.render()
}
}
}
val actual = buildString {
appendLine("expected symbol: $expectedSymbolText")
appendLine("expected symbols:")
appendLine(expectedSymbolText)
}
testServices.assertions.assertEqualsToTestDataFileSibling(actual)