aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/data/format/enumClass.kt4
-rw-r--r--test/data/format/enumClass.md19
-rw-r--r--test/data/format/enumClass.value.md12
-rw-r--r--test/src/TestAPI.kt3
-rw-r--r--test/src/format/MarkdownFormatTest.kt13
5 files changed, 47 insertions, 4 deletions
diff --git a/test/data/format/enumClass.kt b/test/data/format/enumClass.kt
new file mode 100644
index 00000000..5988c644
--- /dev/null
+++ b/test/data/format/enumClass.kt
@@ -0,0 +1,4 @@
+public enum class InlineOption {
+ LOCAL_CONTINUE_AND_BREAK
+ ONLY_LOCAL_RETURN
+}
diff --git a/test/data/format/enumClass.md b/test/data/format/enumClass.md
new file mode 100644
index 00000000..7b3d242b
--- /dev/null
+++ b/test/data/format/enumClass.md
@@ -0,0 +1,19 @@
+[test](out.md) / [](out.md) / [InlineOption](out.md)
+
+
+# InlineOption
+
+
+```
+public enum class InlineOption
+```
+
+
+
+
+### Enum Values
+
+
+| [LOCAL_CONTINUE_AND_BREAK](out.md) | `` |
+| [ONLY_LOCAL_RETURN](out.md) | `` |
+
diff --git a/test/data/format/enumClass.value.md b/test/data/format/enumClass.value.md
new file mode 100644
index 00000000..70dc8eb8
--- /dev/null
+++ b/test/data/format/enumClass.value.md
@@ -0,0 +1,12 @@
+[test](out.md) / [](out.md) / [InlineOption](out.md) / [LOCAL_CONTINUE_AND_BREAK](out.md)
+
+
+# LOCAL_CONTINUE_AND_BREAK
+
+
+```
+LOCAL_CONTINUE_AND_BREAK
+```
+
+
+
diff --git a/test/src/TestAPI.kt b/test/src/TestAPI.kt
index 7d0d3bdd..4d64014e 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 3d32743f..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())
@@ -46,4 +44,15 @@ public class MarkdownFormatTest {
markdownService.appendNodes(tempLocation, output, model.members.single().members)
}
}
+
+ Test fun enumClass() {
+ verifyOutput("test/data/format/enumClass.kt", ".md") { model, output ->
+ markdownService.appendNodes(tempLocation, output, model.members.single().members)
+ }
+ verifyOutput("test/data/format/enumClass.kt", ".value.md") { model, output ->
+ val enumClassNode = model.members.single().members[0]
+ markdownService.appendNodes(tempLocation, output,
+ enumClassNode.members.filter { it.name == "LOCAL_CONTINUE_AND_BREAK" })
+ }
+ }
}