aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/kotlin/model/FunctionTest.kt
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2019-03-18 22:05:22 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2019-03-18 22:05:22 +0300
commitfd2f36301e95f8d100e1c2b942f1590144d8c6c2 (patch)
treedcbf109f14de5301848c29e9721c8e0af6881b3e /core/src/test/kotlin/model/FunctionTest.kt
parentf2359e05347708e625d5a6b339010cda2adc30de (diff)
parent4b22ebab09ce3b934443d063df6b905e5347c390 (diff)
downloaddokka-fd2f36301e95f8d100e1c2b942f1590144d8c6c2.tar.gz
dokka-fd2f36301e95f8d100e1c2b942f1590144d8c6c2.tar.bz2
dokka-fd2f36301e95f8d100e1c2b942f1590144d8c6c2.zip
Merge branch 'dev'
Diffstat (limited to 'core/src/test/kotlin/model/FunctionTest.kt')
-rw-r--r--core/src/test/kotlin/model/FunctionTest.kt27
1 files changed, 27 insertions, 0 deletions
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" }) {