Skip to content

Commit

Permalink
Correct some type attribution test expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
knutwannheden committed Oct 30, 2023
1 parent a10255d commit ef2d45e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package org.openrewrite.kotlin;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junitpioneer.jupiter.ExpectedToFail;
Expand Down Expand Up @@ -121,14 +120,14 @@ void fieldType() {
assertThat(id.getType().toString()).isEqualTo("kotlin.Int");

JavaType.FullyQualified declaringType = property.getGetter().getMethodType().getDeclaringType();
assertThat(declaringType.getFullyQualifiedName()).isEqualTo("org.openrewrite.kotlin.KotlinTypeGoatKt");
assertThat(declaringType.getFullyQualifiedName()).isEqualTo("org.openrewrite.kotlin.KotlinTypeGoat");
assertThat(property.getGetter().getMethodType().getName()).isEqualTo("accessor"); // FIXME
assertThat(property.getGetter().getMethodType().getReturnType()).isEqualTo(id.getType());
assertThat(property.getGetter().getName().getType()).isEqualTo(property.getGetter().getMethodType());
assertThat(property.getGetter().getMethodType().toString().substring(declaringType.toString().length())).isEqualTo("{name=accessor,return=kotlin.Int,parameters=[]}");

declaringType = property.getSetter().getMethodType().getDeclaringType();
assertThat(declaringType.getFullyQualifiedName()).isEqualTo("org.openrewrite.kotlin.KotlinTypeGoatKt");
assertThat(declaringType.getFullyQualifiedName()).isEqualTo("org.openrewrite.kotlin.KotlinTypeGoat");
assertThat(property.getSetter().getMethodType().getName()).isEqualTo("accessor"); // FIXME
assertThat(property.getSetter().getMethodType()).isEqualTo(property.getSetter().getName().getType());
assertThat(property.getSetter().getMethodType().toString().substring(declaringType.toString().length())).isEqualTo("{name=accessor,return=kotlin.Unit,parameters=[kotlin.Int]}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void fileField() {
.filter(it -> it instanceof FirProperty && "field".equals(((FirProperty) it).getName().asString()))
.map(it -> (FirProperty) it).findFirst().orElseThrow();
assertThat(signatureBuilder().variableSignature(firProperty.getSymbol(), getCompiledSource().getSymbol()))
.isEqualTo("KotlinTypeGoatKt{name=field,type=kotlin.Int}");
.isEqualTo("org.openrewrite.kotlin.KotlinTypeGoatKt{name=field,type=kotlin.Int}");
}

@Test
Expand All @@ -182,7 +182,7 @@ void fileFunction() {
.filter(it -> it instanceof FirSimpleFunction && "function".equals(((FirSimpleFunction) it).getName().asString()))
.map(it -> (FirSimpleFunction) it).findFirst().orElseThrow();
assertThat(signatureBuilder().methodDeclarationSignature(function.getSymbol(), getCompiledSource().getSymbol()))
.isEqualTo("KotlinTypeGoatKt{name=function,return=kotlin.Unit,parameters=[org.openrewrite.kotlin.C]}");
.isEqualTo("org.openrewrite.kotlin.KotlinTypeGoatKt{name=function,return=kotlin.Unit,parameters=[org.openrewrite.kotlin.C]}");
}

@Test
Expand Down

0 comments on commit ef2d45e

Please sign in to comment.