aboutsummaryrefslogtreecommitdiff
path: root/core/src/test
diff options
context:
space:
mode:
authorSimon Ogorodnik <sem-oro@yandex.ru>2016-11-29 15:53:53 +0300
committerGitHub <noreply@github.com>2016-11-29 15:53:53 +0300
commit37cbd962b7493aef63067a9f6b7f4abbaa56bc80 (patch)
tree9535169caa2899dab75417b0b788f1ec341b4b0b /core/src/test
parentedda34b73bbbd9537eb499668c47a7a901b284c2 (diff)
parent875e7e5e39c6c1668729685bbc7f51bc07aed4b6 (diff)
downloaddokka-37cbd962b7493aef63067a9f6b7f4abbaa56bc80.tar.gz
dokka-37cbd962b7493aef63067a9f6b7f4abbaa56bc80.tar.bz2
dokka-37cbd962b7493aef63067a9f6b7f4abbaa56bc80.zip
Merge pull request #111 from Kotlin/website-samples
Tweaked output for kotlin-website samples feature
Diffstat (limited to 'core/src/test')
-rw-r--r--core/src/test/kotlin/TestAPI.kt6
-rw-r--r--core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt6
2 files changed, 9 insertions, 3 deletions
diff --git a/core/src/test/kotlin/TestAPI.kt b/core/src/test/kotlin/TestAPI.kt
index 508d28fc..7197d2c4 100644
--- a/core/src/test/kotlin/TestAPI.kt
+++ b/core/src/test/kotlin/TestAPI.kt
@@ -125,8 +125,9 @@ fun verifyOutput(roots: Array<ContentRoot>,
outputExtension: String,
withJdk: Boolean = false,
withKotlinRuntime: Boolean = false,
+ format: String = "html",
outputGenerator: (DocumentationModule, StringBuilder) -> Unit) {
- verifyModel(*roots, withJdk = withJdk, withKotlinRuntime = withKotlinRuntime) {
+ verifyModel(*roots, withJdk = withJdk, withKotlinRuntime = withKotlinRuntime, format = format) {
verifyModelOutput(it, outputExtension, outputGenerator, roots.first().path)
}
}
@@ -147,8 +148,9 @@ fun verifyOutput(path: String,
outputExtension: String,
withJdk: Boolean = false,
withKotlinRuntime: Boolean = false,
+ format: String = "html",
outputGenerator: (DocumentationModule, StringBuilder) -> Unit) {
- verifyOutput(arrayOf(contentRootFromPath(path)), outputExtension, withJdk, withKotlinRuntime, outputGenerator)
+ verifyOutput(arrayOf(contentRootFromPath(path)), outputExtension, withJdk, withKotlinRuntime, format, outputGenerator)
}
fun verifyJavaOutput(path: String,
diff --git a/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt b/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt
index e7419ec8..e7677862 100644
--- a/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt
+++ b/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt
@@ -19,8 +19,12 @@ 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") { model, output ->
+ 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 })
}
}