From c4f40a03404641a9a42e6518cb066f2e0ae609e0 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 12 Jan 2015 16:32:30 +0100 Subject: better display for enum members --- test/src/format/MarkdownFormatTest.kt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/src') diff --git a/test/src/format/MarkdownFormatTest.kt b/test/src/format/MarkdownFormatTest.kt index 3d32743f..8cb6091f 100644 --- a/test/src/format/MarkdownFormatTest.kt +++ b/test/src/format/MarkdownFormatTest.kt @@ -46,4 +46,10 @@ 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) + } + } } -- cgit From 0c584d0e12f07946fdfc8cc0e9f132558ff794fc Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 12 Jan 2015 17:23:07 +0100 Subject: enum values continued --- test/src/format/MarkdownFormatTest.kt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/src') diff --git a/test/src/format/MarkdownFormatTest.kt b/test/src/format/MarkdownFormatTest.kt index 8cb6091f..1b8b1cc0 100644 --- a/test/src/format/MarkdownFormatTest.kt +++ b/test/src/format/MarkdownFormatTest.kt @@ -51,5 +51,9 @@ public class MarkdownFormatTest { 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 documentationNode = model.members.single() + markdownService.appendNodes(tempLocation, output, listOf(documentationNode.members[0].members[1])) + } } } -- cgit From 1ce5373a1f6c99d01db2156a833fcd796ef53e27 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Tue, 13 Jan 2015 16:19:42 +0100 Subject: code review and fix tests on Windows build agents --- test/src/TestAPI.kt | 3 +-- test/src/format/MarkdownFormatTest.kt | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'test/src') 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" }) } } } -- cgit