aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-01-13 16:19:42 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-01-13 16:19:42 +0100
commit1ce5373a1f6c99d01db2156a833fcd796ef53e27 (patch)
tree33838d7b0e8b8c720fcebc2119c5527b76f73179
parentd33f5b8d4268e3b3ea318faeb4b5c63a0b7b71fd (diff)
downloaddokka-1ce5373a1f6c99d01db2156a833fcd796ef53e27.tar.gz
dokka-1ce5373a1f6c99d01db2156a833fcd796ef53e27.tar.bz2
dokka-1ce5373a1f6c99d01db2156a833fcd796ef53e27.zip
code review and fix tests on Windows build agents
-rw-r--r--src/Kotlin/DocumentationBuilder.kt6
-rw-r--r--test/data/format/enumClass.md6
-rw-r--r--test/src/TestAPI.kt3
-rw-r--r--test/src/format/MarkdownFormatTest.kt7
4 files changed, 9 insertions, 13 deletions
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt
index b155ebca..a9b017bb 100644
--- a/src/Kotlin/DocumentationBuilder.kt
+++ b/src/Kotlin/DocumentationBuilder.kt
@@ -212,7 +212,11 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati
node.appendSupertypes(this)
if (getKind() != ClassKind.OBJECT && getKind() != ClassKind.ENUM_ENTRY) {
node.appendChildren(getTypeConstructor().getParameters(), DocumentationReference.Kind.Detail)
- node.appendChildren(getConstructors(), DocumentationReference.Kind.Member)
+ val constructorsToDocument = if (getKind() == ClassKind.ENUM_CLASS)
+ getConstructors().filter { it.getValueParameters().size() > 0 }
+ else
+ getConstructors()
+ node.appendChildren(constructorsToDocument, DocumentationReference.Kind.Member)
}
node.appendChildren(getDefaultType().getMemberScope().getAllDescriptors(), DocumentationReference.Kind.Member)
val classObjectDescriptor = getClassObjectDescriptor()
diff --git a/test/data/format/enumClass.md b/test/data/format/enumClass.md
index e1c4144e..7b3d242b 100644
--- a/test/data/format/enumClass.md
+++ b/test/data/format/enumClass.md
@@ -11,12 +11,6 @@ public enum class InlineOption
-### Constructors
-
-
-| [&lt;init&gt;](out.md) | `private InlineOption()` |
-
-
### Enum Values
diff --git a/test/src/TestAPI.kt b/test/src/TestAPI.kt
index 901e78fc..d6c7efb7 100644
--- a/test/src/TestAPI.kt
+++ b/test/src/TestAPI.kt
@@ -4,7 +4,6 @@ import org.jetbrains.kotlin.cli.common.messages.*
import com.intellij.openapi.util.*
import kotlin.test.fail
import org.jetbrains.dokka.*
-import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import java.io.File
import com.intellij.openapi.application.PathManager
import org.junit.Assert
@@ -54,7 +53,7 @@ public fun verifyOutput(path: String, outputExtension: String, outputGenerator:
verifyModel(path) {
val output = StringBuilder()
outputGenerator(it, output)
- val expectedOutput = File(path.replace(".kt", outputExtension)).readText()
+ val expectedOutput = File(path.replace(".kt", outputExtension)).readText().replace("\r\n", "\n")
Assert.assertEquals(expectedOutput, output.toString())
}
}
diff --git a/test/src/format/MarkdownFormatTest.kt b/test/src/format/MarkdownFormatTest.kt
index 1b8b1cc0..a5a62e13 100644
--- a/test/src/format/MarkdownFormatTest.kt
+++ b/test/src/format/MarkdownFormatTest.kt
@@ -2,8 +2,6 @@ package org.jetbrains.dokka.tests
import org.junit.Test
import org.jetbrains.dokka.*
-import java.io.File
-import kotlin.test.assertEquals
public class MarkdownFormatTest {
private val markdownService = MarkdownFormatService(InMemoryLocationService, KotlinLanguageService())
@@ -52,8 +50,9 @@ public class MarkdownFormatTest {
markdownService.appendNodes(tempLocation, output, model.members.single().members)
}
verifyOutput("test/data/format/enumClass.kt", ".value.md") { model, output ->
- val documentationNode = model.members.single()
- markdownService.appendNodes(tempLocation, output, listOf(documentationNode.members[0].members[1]))
+ val enumClassNode = model.members.single().members[0]
+ markdownService.appendNodes(tempLocation, output,
+ enumClassNode.members.filter { it.name == "LOCAL_CONTINUE_AND_BREAK" })
}
}
}