LL API: add test for kt -> fir mapping of qualified calls

This commit is contained in:
Ilya Kirillov
2021-07-16 09:40:36 +02:00
committed by teamcityserver
parent 3ae1fe69da
commit ddd257adc2
9 changed files with 79 additions and 0 deletions
@@ -0,0 +1,5 @@
fun y(a: Int){}
fun x() {
y(<expr>1</expr>)
}
@@ -0,0 +1,5 @@
KT element: KtValueArgument
FIR element: FirConstExpressionImpl
FIR element rendered:
Int(1)
@@ -0,0 +1,5 @@
fun y<T>(){}
fun x() {
y< <expr>Int</expr> >()
}
@@ -0,0 +1,5 @@
KT element: KtTypeProjection
FIR element: FirTypeProjectionWithVarianceImpl
FIR element rendered:
R|kotlin/Int|
@@ -0,0 +1,7 @@
object A {
fun y(a: Int){}
}
fun x() {
A.<expr>y(1)</expr>
}
@@ -0,0 +1,5 @@
KT element: KtCallExpression
FIR element: FirFunctionCallImpl
FIR element rendered:
Q|A|.R|/A.y|(Int(1))
@@ -0,0 +1,7 @@
object A {
fun y(a: Int){}
}
fun x() {
<expr>A.y(1)</expr>
}
@@ -0,0 +1,5 @@
KT element: KtDotQualifiedExpression
FIR element: FirFunctionCallImpl
FIR element rendered:
Q|A|.R|/A.y|(Int(1))
@@ -79,6 +79,18 @@ public class GetOrBuildFirTestGenerated extends AbstractGetOrBuildFirTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/getOrBuildFir/calls"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("callArgument.kt")
public void testCallArgument() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/getOrBuildFir/calls/callArgument.kt");
}
@Test
@TestMetadata("calllTypeArguments.kt")
public void testCalllTypeArguments() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/getOrBuildFir/calls/calllTypeArguments.kt");
}
@Test
@TestMetadata("constructorDelegationSuperCall.kt")
public void testConstructorDelegationSuperCall() throws Exception {
@@ -102,6 +114,18 @@ public class GetOrBuildFirTestGenerated extends AbstractGetOrBuildFirTest {
public void testInvokeCallArgumentList() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/getOrBuildFir/calls/invokeCallArgumentList.kt");
}
@Test
@TestMetadata("qualifiedCallSelector.kt")
public void testQualifiedCallSelector() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/getOrBuildFir/calls/qualifiedCallSelector.kt");
}
@Test
@TestMetadata("qualifiedWholeCall.kt")
public void testQualifiedWholeCall() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/getOrBuildFir/calls/qualifiedWholeCall.kt");
}
}
@Nested
@@ -177,6 +201,11 @@ public class GetOrBuildFirTestGenerated extends AbstractGetOrBuildFirTest {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/getOrBuildFir/expressions/classAccessExpression.kt");
}
@Test
@TestMetadata("forExpression.kt")
public void testForExpression() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/getOrBuildFir/expressions/forExpression.kt");
}
@Test
@TestMetadata("forExpressionRange.kt")
@@ -184,6 +213,12 @@ public class GetOrBuildFirTestGenerated extends AbstractGetOrBuildFirTest {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/getOrBuildFir/expressions/forExpressionRange.kt");
}
@Test
@TestMetadata("forExpressionVariable.kt")
public void testForExpressionVariable() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/getOrBuildFir/expressions/forExpressionVariable.kt");
}
@Test
@TestMetadata("ifExpression.kt")
public void testIfExpression() throws Exception {