From eb54d69a5cd8e27b1235a23b9098e285c408cb23 Mon Sep 17 00:00:00 2001 From: Andrey Tyrin Date: Tue, 31 Jan 2023 13:25:38 +0100 Subject: fill packageName and classNames for constructors from parent (#2837) --- .../DefaultPsiToDocumentableTranslatorTest.kt | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'plugins/base/src/test/kotlin') diff --git a/plugins/base/src/test/kotlin/translators/DefaultPsiToDocumentableTranslatorTest.kt b/plugins/base/src/test/kotlin/translators/DefaultPsiToDocumentableTranslatorTest.kt index 537a4bfc..5ce6bbb6 100644 --- a/plugins/base/src/test/kotlin/translators/DefaultPsiToDocumentableTranslatorTest.kt +++ b/plugins/base/src/test/kotlin/translators/DefaultPsiToDocumentableTranslatorTest.kt @@ -827,6 +827,29 @@ class DefaultPsiToDocumentableTranslatorTest : BaseAbstractTest() { } } } + + @Test + fun `default constructor should get the package name`() { + testInline( + """ + |/src/main/java/org/test/A.java + |package org.test; + |public class A { + |} + """.trimIndent(), + configuration + ) { + documentablesMergingStage = { module -> + val testedClass = module.findClasslike(packageName = "org.test", "A") as DClass + + assertEquals(1, testedClass.constructors.size, "Expect 1 default constructor") + + val constructorDRI = testedClass.constructors.first().dri + assertEquals("org.test", constructorDRI.packageName) + assertEquals("A", constructorDRI.classNames) + } + } + } } private fun DFunction.visibility() = visibility.values.first() -- cgit