Line Markers: Don't show test run line markers for top-level functions

#KT-13509 Fixed
This commit is contained in:
Alexey Sedunov
2018-01-19 16:10:18 +03:00
parent 8cbf364457
commit bd8a4d78fa
4 changed files with 21 additions and 0 deletions
@@ -142,6 +142,8 @@ class KotlinTestRunLineMarkerContributor : RunLineMarkerContributor() {
if (declaration !is KtClassOrObject && declaration !is KtNamedFunction) return null
if (declaration is KtNamedFunction && declaration.containingClassOrObject == null) return null
// To prevent IDEA failing on red code
val descriptor = declaration.resolveToDescriptorIfAny() ?: return null
@@ -0,0 +1,6 @@
// !CHECK_HIGHLIGHTING
package kotlin.test
annotation class Test
annotation class Ignore
@@ -0,0 +1,9 @@
import kotlin.test.*
@Test fun testFoo() {
}
@Ignore fun testFooWrong() {
}
@@ -110,6 +110,10 @@ class MultiModuleLineMarkerTest : AbstractMultiModuleHighlightingTest() {
})
}
fun testTopLevelFunWithKotlinTest() {
doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6])
}
fun testSuspendImplInPlatformModules() {
doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6], TargetPlatformKind.JavaScript)
}