diff options
author | Krystian Ujma <krystianujma@gmail.com> | 2018-12-14 18:05:36 +0100 |
---|---|---|
committer | Simon Ogorodnik <simon.ogorodnik@gmail.com> | 2018-12-14 20:05:36 +0300 |
commit | 45187825aa63e5d1c3ac7fc3ae1b88aa34048812 (patch) | |
tree | 4364b3a98b98ce3660752289f5f30c15e1e0eacf /core/src/test/kotlin | |
parent | b0310f8f3e242ffc64c56e8fd95710b25b37dfff (diff) | |
download | dokka-45187825aa63e5d1c3ac7fc3ae1b88aa34048812.tar.gz dokka-45187825aa63e5d1c3ac7fc3ae1b88aa34048812.tar.bz2 dokka-45187825aa63e5d1c3ac7fc3ae1b88aa34048812.zip |
Modifiers sorted in wrong order #389
Fix #389 (modifiers sorted in wrong order)
Diffstat (limited to 'core/src/test/kotlin')
-rw-r--r-- | core/src/test/kotlin/format/MarkdownFormatTest.kt | 8 | ||||
-rw-r--r-- | core/src/test/kotlin/model/FunctionTest.kt | 27 |
2 files changed, 35 insertions, 0 deletions
diff --git a/core/src/test/kotlin/format/MarkdownFormatTest.kt b/core/src/test/kotlin/format/MarkdownFormatTest.kt index a456836d..9fb34e95 100644 --- a/core/src/test/kotlin/format/MarkdownFormatTest.kt +++ b/core/src/test/kotlin/format/MarkdownFormatTest.kt @@ -165,6 +165,14 @@ class MarkdownFormatTest: FileGeneratorTestCase() { verifyMarkdownNode("reifiedTypeParameter", withKotlinRuntime = true) } + @Test fun suspendInlineFunctionOrder() { + verifyMarkdownNode("suspendInlineFunction", withKotlinRuntime = true) + } + + @Test fun inlineSuspendFunctionOrderChanged() { + verifyMarkdownNode("inlineSuspendFunction", withKotlinRuntime = true) + } + @Test fun annotatedTypeParameter() { verifyMarkdownNode("annotatedTypeParameter", withKotlinRuntime = true) } diff --git a/core/src/test/kotlin/model/FunctionTest.kt b/core/src/test/kotlin/model/FunctionTest.kt index 32910682..fd7a16a4 100644 --- a/core/src/test/kotlin/model/FunctionTest.kt +++ b/core/src/test/kotlin/model/FunctionTest.kt @@ -167,6 +167,33 @@ Documentation""", content.description.toTestString()) } } + @Test fun suspendFunction() { + verifyPackageMember("testdata/functions/suspendFunction.kt") { func -> + val modifiers = func.details(NodeKind.Modifier).map { it.name } + assertTrue("suspend" in modifiers) + } + } + + @Test fun suspendInlineFunctionOrder() { + verifyPackageMember("testdata/functions/suspendInlineFunction.kt") { func -> + val modifiers = func.details(NodeKind.Modifier).map { it.name }.filter { + it == "suspend" || it == "inline" + } + + assertEquals(listOf("suspend", "inline"), modifiers) + } + } + + @Test fun inlineSuspendFunctionOrderChanged() { + verifyPackageMember("testdata/functions/inlineSuspendFunction.kt") { func -> + val modifiers = func.details(NodeKind.Modifier).map { it.name }.filter { + it == "suspend" || it == "inline" + } + + assertEquals(listOf("suspend", "inline"), modifiers) + } + } + @Test fun functionWithAnnotatedParam() { verifyModel("testdata/functions/functionWithAnnotatedParam.kt") { model -> with(model.members.single().members.single { it.name == "function" }) { |