diff options
author | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2016-11-30 18:25:57 +0300 |
---|---|---|
committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2016-11-30 18:25:57 +0300 |
commit | 039bb97123fd8a74b9954598d7a102e235fd108d (patch) | |
tree | 2cf4a8a8c7beddb46ec6f6d34f4b1299dd053f5a /core/src/test/kotlin | |
parent | 0e3fe9f50cb52a783666291c2f2d618706617bc3 (diff) | |
download | dokka-039bb97123fd8a74b9954598d7a102e235fd108d.tar.gz dokka-039bb97123fd8a74b9954598d7a102e235fd108d.tar.bz2 dokka-039bb97123fd8a74b9954598d7a102e235fd108d.zip |
Fixed tests for sample formats
Diffstat (limited to 'core/src/test/kotlin')
-rw-r--r-- | core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt | 4 | ||||
-rw-r--r-- | core/src/test/kotlin/format/KotlinWebSiteRunnableSamplesFormatTest.kt | 23 |
2 files changed, 23 insertions, 4 deletions
diff --git a/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt b/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt index e7677862..3363b0a3 100644 --- a/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt +++ b/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt @@ -19,10 +19,6 @@ class KotlinWebSiteFormatTest { verifyKWSNodeByName("overloadGroup", "magic") } - @Test fun sampleWithAsserts() { - verifyKWSNodeByName("sampleWithAsserts", "a") - } - private fun verifyKWSNodeByName(fileName: String, name: String) { verifyOutput("testdata/format/website/$fileName.kt", ".md", format = "kotlin-website") { model, output -> kwsService.createOutputBuilder(output, tempLocation).appendNodes(model.members.single().members.filter { it.name == name }) diff --git a/core/src/test/kotlin/format/KotlinWebSiteRunnableSamplesFormatTest.kt b/core/src/test/kotlin/format/KotlinWebSiteRunnableSamplesFormatTest.kt new file mode 100644 index 00000000..1f514932 --- /dev/null +++ b/core/src/test/kotlin/format/KotlinWebSiteRunnableSamplesFormatTest.kt @@ -0,0 +1,23 @@ +package org.jetbrains.dokka.tests + +import org.jetbrains.dokka.KotlinLanguageService +import org.jetbrains.dokka.KotlinWebsiteRunnableSamplesFormatService +import org.junit.Test + +class KotlinWebSiteRunnableSamplesFormatTest { + private val kwsService = KotlinWebsiteRunnableSamplesFormatService(InMemoryLocationService, KotlinLanguageService()) + + @Test fun sample() { + verifyKWSNodeByName("sample", "foo") + } + + @Test fun sampleWithAsserts() { + verifyKWSNodeByName("sampleWithAsserts", "a") + } + + private fun verifyKWSNodeByName(fileName: String, name: String) { + verifyOutput("testdata/format/website-samples/$fileName.kt", ".md", format = "kotlin-website-samples") { model, output -> + kwsService.createOutputBuilder(output, tempLocation).appendNodes(model.members.single().members.filter { it.name == name }) + } + } +} |