From 7b511e8352b880330d602238e6370b8949aac76a Mon Sep 17 00:00:00 2001 From: Kun Li Date: Thu, 9 Nov 2023 09:42:01 -0800 Subject: [PATCH] move anonymousObject to KTSTest --- .../kotlin/format/TabsAndIndentsTest.java | 7 +++--- .../org/openrewrite/kotlin/tree/KTSTest.java | 22 +++++++++++++++++++ .../kotlin/tree/MethodInvocationTest.java | 20 ----------------- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/test/java/org/openrewrite/kotlin/format/TabsAndIndentsTest.java b/src/test/java/org/openrewrite/kotlin/format/TabsAndIndentsTest.java index 4bc154353..0a66498f1 100644 --- a/src/test/java/org/openrewrite/kotlin/format/TabsAndIndentsTest.java +++ b/src/test/java/org/openrewrite/kotlin/format/TabsAndIndentsTest.java @@ -443,7 +443,6 @@ fun method(t: Test) { ); } - @ExpectedToFail("https://github.com/openrewrite/rewrite/issues/636") @Test void methodInvocationArgumentsContinuationIndentsAssorted() { rewriteRun( @@ -457,12 +456,12 @@ fun withData(vararg arg0: Test): Test { fun method(t: Test) { val t1 = t.withData(withData() .withData( - t.withData() + t.withData() ).withData( - t.withData() + t.withData() ) .withData(), - withData() + withData() ); } } diff --git a/src/test/java/org/openrewrite/kotlin/tree/KTSTest.java b/src/test/java/org/openrewrite/kotlin/tree/KTSTest.java index edaecace4..a01cea128 100644 --- a/src/test/java/org/openrewrite/kotlin/tree/KTSTest.java +++ b/src/test/java/org/openrewrite/kotlin/tree/KTSTest.java @@ -16,6 +16,7 @@ package org.openrewrite.kotlin.tree; import org.junit.jupiter.api.Test; +import org.junitpioneer.jupiter.ExpectedToFail; import org.openrewrite.java.tree.J; import org.openrewrite.kotlin.KotlinIsoVisitor; import org.openrewrite.test.RewriteTest; @@ -23,6 +24,7 @@ import java.util.concurrent.atomic.AtomicInteger; import static org.assertj.core.api.Assertions.assertThat; +import static org.openrewrite.kotlin.Assertions.kotlin; import static org.openrewrite.kotlin.Assertions.kotlinScript; class KTSTest implements RewriteTest { @@ -84,4 +86,24 @@ public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, Atomi })) ); } + + @ExpectedToFail("not yet implemented correctly") + @Test + void anonymousObject() { + rewriteRun( + kotlinScript( + """ + open class Test + interface A + + fun test ( a : Test ) { } + + fun method ( ) { + test ( object : Test ( ), A { + } ) + } + """ + ) + ); + } } diff --git a/src/test/java/org/openrewrite/kotlin/tree/MethodInvocationTest.java b/src/test/java/org/openrewrite/kotlin/tree/MethodInvocationTest.java index 756138e75..f81b1451c 100644 --- a/src/test/java/org/openrewrite/kotlin/tree/MethodInvocationTest.java +++ b/src/test/java/org/openrewrite/kotlin/tree/MethodInvocationTest.java @@ -239,26 +239,6 @@ fun methodB ( ) { ); } - @Test - @ExpectedToFail("not yet implemented correctly") - void anonymousObject() { - rewriteRun( - kotlin( - """ - open class Test - interface A - - fun test ( a : Test ) { } - - fun method ( ) { - test ( object : Test ( ), A { - } ) - } - """ - ) - ); - } - @Test void lambdaArgument() { rewriteRun(