From 303c937a7c33fa9df5c28079c423ee071e87e410 Mon Sep 17 00:00:00 2001 From: Andrey Tyrin Date: Thu, 12 Jan 2023 20:03:06 +0100 Subject: Default Java constructor (#2795) --- .../src/test/kotlin/KotlinAsJavaPluginTest.kt | 27 +++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt') diff --git a/plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt b/plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt index b43cea05..24c58e8e 100644 --- a/plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt +++ b/plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt @@ -13,8 +13,13 @@ import org.jetbrains.kotlin.utils.addToStdlib.cast import org.junit.Assert import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test -import signatures.* -import utils.* +import signatures.Parameter +import signatures.Parameters +import signatures.firstSignature +import signatures.renderedContent +import utils.A +import utils.TestOutputWriterPlugin +import utils.match import kotlin.test.assertEquals class KotlinAsJavaPluginTest : BaseAbstractTest() { @@ -134,9 +139,18 @@ class KotlinAsJavaPluginTest : BaseAbstractTest() { } classes["TestJ"].let { - it?.children.orEmpty().assertCount(1, "(Java) TestJ members: ") - it!!.children.first() - .let { assert(it.name == "testF") { "(Java) Expected method name: testF, got: ${it.name}" } } + it?.children.orEmpty().assertCount(2, "(Java) TestJ members: ") // constructor + method + it!!.children.map { it.name } + .let { + assert( + it.containsAll( + setOf( + "testF", + "TestJ" + ) + ) + ) { "(Java) Expected method name: testF, got: $it" } + } } } } @@ -220,8 +234,9 @@ class KotlinAsJavaPluginTest : BaseAbstractTest() { val testClass = root.dfs { it.name == "TestJ" } as? ClasslikePageNode assert(testClass != null) (testClass!!.content as ContentGroup).children.last().assertNode { + skipAllNotMatching() group { - header(2){ + header(2) { +"Properties" } table { -- cgit