aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/kotlin/model/FunctionTest.kt
diff options
context:
space:
mode:
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" }) {