From 67b6e48ceee2776e48541918a2bace64ad9c11e6 Mon Sep 17 00:00:00 2001 From: Simon Vergauwen Date: Thu, 6 Apr 2023 09:43:23 +0200 Subject: [PATCH 1/2] Add tests for lambda modifiers --- .../kotlin/tree/MethodDeclarationTest.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/test/java/org/openrewrite/kotlin/tree/MethodDeclarationTest.java b/src/test/java/org/openrewrite/kotlin/tree/MethodDeclarationTest.java index 154f19ada..1ae67e241 100644 --- a/src/test/java/org/openrewrite/kotlin/tree/MethodDeclarationTest.java +++ b/src/test/java/org/openrewrite/kotlin/tree/MethodDeclarationTest.java @@ -16,6 +16,7 @@ package org.openrewrite.kotlin.tree; import org.junit.jupiter.api.Test; +import org.junitpioneer.jupiter.ExpectedToFail; import org.openrewrite.Issue; import org.openrewrite.test.RewriteTest; @@ -210,4 +211,32 @@ suspend fun example ( ) ); } + + @Issue("https://github.com/openrewrite/rewrite-kotlin/issues/70") + @Test + @ExpectedToFail + void crossinline() { + rewriteRun( + kotlin( + """ + inline fun example( + crossinline block: () -> Unit + ): Unit = Unit + """) + ); + } + + @Issue("https://github.com/openrewrite/rewrite-kotlin/issues/70") + @Test + @ExpectedToFail + void noinline() { + rewriteRun( + kotlin( + """ + inline fun example( + noinline block: () -> Unit + ): Unit = Unit + """) + ); + } } From 070efbbab3a483d9293495f125a5984f1492f9ad Mon Sep 17 00:00:00 2001 From: Simon Vergauwen Date: Thu, 6 Apr 2023 10:17:14 +0200 Subject: [PATCH 2/2] Add spaces --- .../kotlin/tree/MethodDeclarationTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/java/org/openrewrite/kotlin/tree/MethodDeclarationTest.java b/src/test/java/org/openrewrite/kotlin/tree/MethodDeclarationTest.java index 1ae67e241..50303736b 100644 --- a/src/test/java/org/openrewrite/kotlin/tree/MethodDeclarationTest.java +++ b/src/test/java/org/openrewrite/kotlin/tree/MethodDeclarationTest.java @@ -219,9 +219,9 @@ void crossinline() { rewriteRun( kotlin( """ - inline fun example( - crossinline block: () -> Unit - ): Unit = Unit + inline fun example ( + crossinline block : ( ) -> Unit + ) : Unit = Unit """) ); } @@ -233,9 +233,9 @@ void noinline() { rewriteRun( kotlin( """ - inline fun example( - noinline block: () -> Unit - ): Unit = Unit + inline fun example ( + noinline block : ( ) -> Unit + ) : Unit = Unit """) ); }