Skip to content

Commit

Permalink
move anonymousObject to KTSTest
Browse files Browse the repository at this point in the history
  • Loading branch information
kunli2 committed Nov 9, 2023
1 parent 4746bcd commit 7b511e8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,6 @@ fun method(t: Test) {
);
}

@ExpectedToFail("https://github.com/openrewrite/rewrite/issues/636")
@Test
void methodInvocationArgumentsContinuationIndentsAssorted() {
rewriteRun(
Expand All @@ -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()
);
}
}
Expand Down
22 changes: 22 additions & 0 deletions src/test/java/org/openrewrite/kotlin/tree/KTSTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
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;

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 {
Expand Down Expand Up @@ -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 {
} )
}
"""
)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 7b511e8

Please sign in to comment.