201: Fix setup for AbstractKotlinExceptionFilterTest tests

This commit is contained in:
Nikolay Krasko
2020-03-06 16:39:51 +03:00
parent 9370260022
commit 72a0a5327c
@@ -90,7 +90,8 @@ abstract class AbstractKotlinExceptionFilterTest : KotlinCodeInsightTestCase() {
val filter = KotlinExceptionFilterFactory().create(GlobalSearchScope.allScope(project))
val prefix = InTextDirectivesUtils.findStringWithPrefixes(fileText, "// PREFIX: ") ?: "at"
val stackTraceString = stackTraceElement.toString()
var result = filter.applyFilter("$prefix $stackTraceString", 0)
val text = "$prefix $stackTraceString"
var result = filter.applyFilter(text, text.length)
?: throw AssertionError("Couldn't apply filter to $stackTraceElement")
if (InTextDirectivesUtils.isDirectiveDefined(fileText, "SMAP_APPLIED")) {
@@ -104,7 +105,8 @@ abstract class AbstractKotlinExceptionFilterTest : KotlinCodeInsightTestCase() {
.replace(mainFile.name, file.name)
.replace(Regex(":\\d+\\)"), ":$line)")
result = filter.applyFilter("$prefix $newStackString", 0) ?: throw AssertionError("Couldn't apply filter to $stackTraceElement")
val newLine = "$prefix $newStackString"
result = filter.applyFilter(newLine, newLine.length) ?: throw AssertionError("Couldn't apply filter to $stackTraceElement")
}
val info = result.firstHyperlinkInfo as FileHyperlinkInfo