[FIR] Update parser test data
This commit is contained in:
committed by
TeamCityServer
parent
6776930881
commit
a0982341ee
+1
-1
@@ -521,7 +521,7 @@ KtFile: PropertiesWithFunctionReceivers.kt
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiErrorElement:Expecting a top level declaration
|
||||
PsiElement(IDENTIFIER)('set')
|
||||
PsiElement(set)('set')
|
||||
PsiErrorElement:Expecting a top level declaration
|
||||
PsiElement(LPAR)('(')
|
||||
PsiErrorElement:Expecting a top level declaration
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
val simpleNumber: Number
|
||||
field = 4
|
||||
|
||||
val numberWithPrivateField: Number
|
||||
private field = 4
|
||||
|
||||
val numberWithLateinitField: Number
|
||||
lateinit field: Int
|
||||
|
||||
val numberWithInternalLateinitField: Number
|
||||
internal lateinit field: Int
|
||||
|
||||
var numberWithFieldAndAccessors: Number
|
||||
field = "test"
|
||||
get() = field.length
|
||||
set(value) {
|
||||
field = value.toString()
|
||||
}
|
||||
|
||||
val numberWithExplicitType: Number
|
||||
field: Int = 10
|
||||
|
||||
val numberWithBlockInitializer: Number
|
||||
field {
|
||||
return 10
|
||||
}
|
||||
|
||||
val minimalNumber
|
||||
field
|
||||
@@ -0,0 +1,218 @@
|
||||
KtFile: explicitBackingField.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
IMPORT_LIST
|
||||
<empty list>
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('simpleNumber')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Number')
|
||||
PsiWhiteSpace('\n ')
|
||||
BACKING_FIELD
|
||||
PsiElement(field)('field')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('4')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('numberWithPrivateField')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Number')
|
||||
PsiWhiteSpace('\n ')
|
||||
BACKING_FIELD
|
||||
MODIFIER_LIST
|
||||
PsiElement(private)('private')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(field)('field')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('4')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('numberWithLateinitField')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Number')
|
||||
PsiWhiteSpace('\n ')
|
||||
BACKING_FIELD
|
||||
MODIFIER_LIST
|
||||
PsiElement(lateinit)('lateinit')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(field)('field')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('numberWithInternalLateinitField')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Number')
|
||||
PsiWhiteSpace('\n ')
|
||||
BACKING_FIELD
|
||||
MODIFIER_LIST
|
||||
PsiElement(internal)('internal')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(lateinit)('lateinit')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(field)('field')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PROPERTY
|
||||
PsiElement(var)('var')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('numberWithFieldAndAccessors')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Number')
|
||||
PsiWhiteSpace('\n ')
|
||||
BACKING_FIELD
|
||||
PsiElement(field)('field')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
STRING_TEMPLATE
|
||||
PsiElement(OPEN_QUOTE)('"')
|
||||
LITERAL_STRING_TEMPLATE_ENTRY
|
||||
PsiElement(REGULAR_STRING_PART)('test')
|
||||
PsiElement(CLOSING_QUOTE)('"')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY_ACCESSOR
|
||||
PsiElement(get)('get')
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('field')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('length')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY_ACCESSOR
|
||||
PsiElement(set)('set')
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER_LIST
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('value')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
BINARY_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('field')
|
||||
PsiWhiteSpace(' ')
|
||||
OPERATION_REFERENCE
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('value')
|
||||
PsiElement(DOT)('.')
|
||||
CALL_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('toString')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('numberWithExplicitType')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Number')
|
||||
PsiWhiteSpace('\n ')
|
||||
BACKING_FIELD
|
||||
PsiElement(field)('field')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('10')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('numberWithBlockInitializer')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Number')
|
||||
PsiWhiteSpace('\n ')
|
||||
BACKING_FIELD
|
||||
PsiElement(field)('field')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
RETURN
|
||||
PsiElement(return)('return')
|
||||
PsiWhiteSpace(' ')
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('10')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('minimalNumber')
|
||||
PsiWhiteSpace('\n ')
|
||||
BACKING_FIELD
|
||||
PsiElement(field)('field')
|
||||
@@ -1983,6 +1983,24 @@ public class ParsingTestGenerated extends AbstractParsingTest {
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/psi/propertyBackingField")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class PropertyBackingField extends AbstractParsingTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doParsingTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInPropertyBackingField() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/psi/propertyBackingField"), Pattern.compile("^(.*)\\.kts?$"), null, true);
|
||||
}
|
||||
|
||||
@TestMetadata("explicitBackingField.kt")
|
||||
public void testExplicitBackingField() throws Exception {
|
||||
runTest("compiler/testData/psi/propertyBackingField/explicitBackingField.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/psi/propertyDelegate")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Reference in New Issue
Block a user