HL API: restore SymbolByReferenceTest

Now it is possible as references are working in HL API tests now
This commit is contained in:
Ilya Kirillov
2021-07-21 17:40:47 +02:00
committed by teamcityserver
parent c678d4b506
commit f19dfd9d2a
6 changed files with 66 additions and 36 deletions

View File

@@ -57,10 +57,9 @@ fun main(args: Array<String>) {
model("symbols/symbolByFqName")
}
// todo
// testClass<AbstractSymbolByReferenceTest> {
// model("symbols/symbolByReference")
// }
testClass<AbstractSymbolByReferenceTest> {
model("symbols/symbolByReference")
}
testClass<AbstractExpectedExpressionTypeTest> {
model("components/expectedExpressionType")

View File

@@ -3,16 +3,3 @@ var x: Int = 0
set(value) {
field = value
}
// RESULT
/*
KtFirBackingFieldSymbol:
annotatedType: [] kotlin/Int
callableIdIfNonLocal: null
isExtension: false
name: field
origin: PROPERTY_BACKING_FIELD
owningProperty: KtFirKotlinPropertySymbol(x)
receiverType: null
symbolKind: LOCAL
*/

View File

@@ -0,0 +1,9 @@
KtFirBackingFieldSymbol:
annotatedType: [] kotlin/Int
callableIdIfNonLocal: null
isExtension: false
name: field
origin: PROPERTY_BACKING_FIELD
owningProperty: KtFirKotlinPropertySymbol(x)
receiverType: null
symbolKind: LOCAL

View File

@@ -4,22 +4,3 @@
fun x() {
val a = <caret>ArrayList(listOf(1))
}
// RESULT
/*
KtFirConstructorSymbol:
annotatedType: [] java/util/ArrayList<E>
annotationClassIds: []
annotations: []
callableIdIfNonLocal: null
containingClassIdIfNonLocal: java/util/ArrayList
dispatchType: java/util/ArrayList<E>
isExtension: false
isPrimary: false
origin: JAVA
receiverType: null
symbolKind: MEMBER
typeParameters: [KtFirTypeParameterSymbol(E)]
valueParameters: [KtFirValueParameterSymbol(c)]
visibility: Public
*/

View File

@@ -0,0 +1,16 @@
KtFirConstructorSymbol:
annotatedType: [] java/util/ArrayList<E>
annotationClassIds: []
annotations: []
callableIdIfNonLocal: null
containingClassIdIfNonLocal: java/util/ArrayList
dispatchType: java/util/ArrayList<E>
hasStableParameterNames: false
isExtension: false
isPrimary: false
origin: JAVA
receiverType: null
symbolKind: MEMBER
typeParameters: [KtFirTypeParameterSymbol(E)]
valueParameters: [KtFirValueParameterSymbol(p0)]
visibility: Public

View File

@@ -0,0 +1,38 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.fir.frontend.api.symbols;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.kotlin.test.TestMetadata;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import java.io.File;
import java.util.regex.Pattern;
/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("idea/idea-frontend-fir/testData/symbols/symbolByReference")
@TestDataPath("$PROJECT_ROOT")
public class SymbolByReferenceTestGenerated extends AbstractSymbolByReferenceTest {
@Test
@TestMetadata("accessorField.kt")
public void testAccessorField() throws Exception {
runTest("idea/idea-frontend-fir/testData/symbols/symbolByReference/accessorField.kt");
}
@Test
public void testAllFilesPresentInSymbolByReference() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/idea-frontend-fir/testData/symbols/symbolByReference"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("constructorViaTypeAlias.kt")
public void testConstructorViaTypeAlias() throws Exception {
runTest("idea/idea-frontend-fir/testData/symbols/symbolByReference/constructorViaTypeAlias.kt");
}
}