diff options
author | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-07-11 17:16:09 +0400 |
---|---|---|
committer | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-07-11 17:16:09 +0400 |
commit | deae3bfbe0a5bda997f3033693879042a058de3a (patch) | |
tree | 6cdf65a860a517e44cc8e7744678b2561ae7a49d | |
parent | 044e1b86602662c78bb2ed12b9d645ab10b23429 (diff) | |
download | dokka-deae3bfbe0a5bda997f3033693879042a058de3a.tar.gz dokka-deae3bfbe0a5bda997f3033693879042a058de3a.tar.bz2 dokka-deae3bfbe0a5bda997f3033693879042a058de3a.zip |
Bootstrapped TDD, first test red then green.
-rw-r--r-- | src/DocumentationModel.kt | 7 | ||||
-rw-r--r-- | test/data/function.kt | 4 | ||||
-rw-r--r-- | test/src/DiscoveryTest.kt | 7 |
3 files changed, 16 insertions, 2 deletions
diff --git a/src/DocumentationModel.kt b/src/DocumentationModel.kt index 6da18d42..77b38d79 100644 --- a/src/DocumentationModel.kt +++ b/src/DocumentationModel.kt @@ -3,10 +3,17 @@ package com.jetbrains.dokka import com.intellij.psi.PsiFile import org.jetbrains.jet.lang.resolve.BindingContext +public class DocumentationNode { + val name = "fn" + val doc = "doc" +} + public class DocumentationModel { fun merge(other: DocumentationModel): DocumentationModel { return DocumentationModel() } + + val items : List<DocumentationNode> = listOf(DocumentationNode()) } fun BindingContext.createDocumentation(file: PsiFile): DocumentationModel { diff --git a/test/data/function.kt b/test/data/function.kt index e69de29b..878b017b 100644 --- a/test/data/function.kt +++ b/test/data/function.kt @@ -0,0 +1,4 @@ +/** + * doc + */ +fun fn() {}
\ No newline at end of file diff --git a/test/src/DiscoveryTest.kt b/test/src/DiscoveryTest.kt index 690f0404..f854b4d6 100644 --- a/test/src/DiscoveryTest.kt +++ b/test/src/DiscoveryTest.kt @@ -1,12 +1,15 @@ package com.jetbrains.dokka.tests import org.junit.Test +import kotlin.test.* public class FunctionTest { Test fun function() { - verifyFiles("test/data/function.kt") { - + verifyFiles("test/data/function.kt") { model -> + val item = model.items.single() + assertEquals("fn", item.name) + assertEquals("doc", item.doc) } } }
\ No newline at end of file |