FIR IDE: handle . after package name in completion tests

This commit is contained in:
Ilya Kirillov
2021-05-26 15:44:42 +02:00
committed by TeamCityServer
parent 4785f36d8d
commit a926a1f534
@@ -64,7 +64,18 @@ object ExpectedCompletionUtils {
}
}
fun matches(expectedProposal: CompletionProposal): Boolean = expectedProposal.map.entries.none { it.value != map[it.key] }
fun matches(expectedProposal: CompletionProposal): Boolean {
return expectedProposal.map.entries.none { expected ->
val actualValues = when (expected.key) {
"lookupString" -> {
// FIR IDE adds `.` after package names in completion
listOf(map[expected.key]?.removeSuffix("."), map[expected.key])
}
else -> listOf(map[expected.key])
}
expected.value !in actualValues
}
}
override fun toString(): String {
val jsonObject = JsonObject()