diff options
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 }) + } + } +} |