Skip to content

Commit

Permalink
Disable kotlin flag and add OnlyDescriptors for test
Browse files Browse the repository at this point in the history
  • Loading branch information
whyoleg committed Nov 17, 2023
1 parent f6504c3 commit 9f31d14
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ internal fun getLanguageVersionSettings(
apiVersion = apiVersion, analysisFlags = hashMapOf(
// special flag for Dokka
// force to resolve light classes (lazily by default)
AnalysisFlags.eagerResolveOfLightClasses to true,
// TODO: looks like we need to hide it under a flag?
AnalysisFlags.allowKotlinPackage to true
AnalysisFlags.eagerResolveOfLightClasses to true
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.MethodSource
import testApi.testRunner.dokkaConfiguration
import utils.OnlyDescriptors
import kotlin.test.assertEquals

class ObviousAndInheritedFunctionsDocumentableFilterTest : BaseAbstractTest() {
Expand Down Expand Up @@ -202,7 +203,9 @@ class ObviousAndInheritedFunctionsDocumentableFilterTest : BaseAbstractTest() {

@ParameterizedTest
@MethodSource(value = ["nonSuppressingObviousConfiguration", "nonSuppressingInheritedConfiguration"])
fun `not should suppress toString, equals and hashcode for interface if custom config is provided`(nonSuppressingConfiguration: DokkaConfigurationImpl) {
fun `not should suppress toString, equals and hashcode for interface if custom config is provided`(
nonSuppressingConfiguration: DokkaConfigurationImpl
) {
testInline(
"""
/src/suppressed/Suppressed.kt
Expand All @@ -220,7 +223,9 @@ class ObviousAndInheritedFunctionsDocumentableFilterTest : BaseAbstractTest() {

@ParameterizedTest
@MethodSource(value = ["nonSuppressingObviousConfiguration", "nonSuppressingInheritedConfiguration"])
fun `should not suppress toString, equals and hashcode if custom config is provided in Java`(nonSuppressingConfiguration: DokkaConfigurationImpl) {
fun `should not suppress toString, equals and hashcode if custom config is provided in Java`(
nonSuppressingConfiguration: DokkaConfigurationImpl
) {
testInline(
"""
/src/suppressed/Suppressed.java
Expand All @@ -247,6 +252,7 @@ class ObviousAndInheritedFunctionsDocumentableFilterTest : BaseAbstractTest() {
}
}

@OnlyDescriptors("#3354")
@ParameterizedTest
@MethodSource(value = ["suppressingObviousConfiguration"])
fun `should not suppress toString, equals and hashcode of kotlin Any`(suppressingConfiguration: DokkaConfigurationImpl) {
Expand All @@ -264,11 +270,12 @@ class ObviousAndInheritedFunctionsDocumentableFilterTest : BaseAbstractTest() {
) {
preMergeDocumentablesTransformationStage = { modules ->
val functions = modules.flatMap { it.packages }.flatMap { it.classlikes }.flatMap { it.functions }
assertEquals(3, functions.size)
assertEquals(setOf("equals", "hashCode", "toString"), functions.map { it.name }.toSet())
}
}
}

@OnlyDescriptors("#3196")
@ParameterizedTest
@MethodSource(value = ["suppressingObviousConfiguration"])
fun `should not suppress toString, equals and hashcode of kotlin Enum`(suppressingConfiguration: DokkaConfigurationImpl) {
Expand All @@ -287,10 +294,7 @@ class ObviousAndInheritedFunctionsDocumentableFilterTest : BaseAbstractTest() {
) {
preMergeDocumentablesTransformationStage = { modules ->
val functions = modules.flatMap { it.packages }.flatMap { it.classlikes }.flatMap { it.functions }
// TODO: fails on K2 (functions.size=5)
// for some reason functions contains getDeclaringClass from Enum.java
// no such function exists when using K1
assertEquals(4, functions.size)
assertEquals(setOf("compareTo", "equals", "hashCode", "toString"), functions.map { it.name }.toSet())
}
}
}
Expand Down

0 comments on commit 9f31d14

Please sign in to comment.