K2: Added test for data class metadata

#KT-57622 Fixed
This commit is contained in:
Pavel Kunyavskiy
2023-04-18 14:36:46 +02:00
committed by Space Team
parent f48142a6e6
commit f67f8c393b
20 changed files with 146 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
// MUTED_WHEN: K1
package test
data class DataClass(
val intProp: Int,
val stringProp: String
) {
val nonConstructorProp: Int = 0
}
data object DataObject
@@ -0,0 +1,16 @@
data class DataClass constructor(intProp: Int, stringProp: String) {
val intProp: Int
val nonConstructorProp: Int = 0
val stringProp: String
operator fun component1(): Int
operator fun component2(): String
fun copy(intProp: Int = ..., stringProp: String = ...): DataClass
override fun equals(other: Any?): Boolean
override fun hashCode(): Int
override fun toString(): String
}
data object DataObject {
override fun equals(other: Any?): Boolean
override fun hashCode(): Int
override fun toString(): String
}
@@ -11119,6 +11119,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
runTest("compiler/testData/codegen/box/dataClasses/floatParam.kt");
}
@Test
@TestMetadata("fromOtherModule.kt")
public void testFromOtherModule() throws Exception {
runTest("compiler/testData/codegen/box/dataClasses/fromOtherModule.kt");
}
@Test
@TestMetadata("genericParam.kt")
public void testGenericParam() throws Exception {
@@ -11371,6 +11371,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
runTest("compiler/testData/codegen/box/dataClasses/floatParam.kt");
}
@Test
@TestMetadata("fromOtherModule.kt")
public void testFromOtherModule() throws Exception {
runTest("compiler/testData/codegen/box/dataClasses/fromOtherModule.kt");
}
@Test
@TestMetadata("genericParam.kt")
public void testGenericParam() throws Exception {
@@ -40,6 +40,12 @@ public class FirNativeKLibContentsTestGenerated extends AbstractNativeKlibConten
runTest("native/native.tests/testData/klibContents/annotations_source_retention.kt");
}
@Test
@TestMetadata("data_class.kt")
public void testData_class() throws Exception {
runTest("native/native.tests/testData/klibContents/data_class.kt");
}
@Test
@TestMetadata("kt55464_serializeTypeAnnotation.kt")
public void testKt55464_serializeTypeAnnotation() throws Exception {
@@ -10994,6 +10994,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
runTest("compiler/testData/codegen/box/dataClasses/floatParam.kt");
}
@Test
@TestMetadata("fromOtherModule.kt")
public void testFromOtherModule() throws Exception {
runTest("compiler/testData/codegen/box/dataClasses/fromOtherModule.kt");
}
@Test
@TestMetadata("genericParam.kt")
public void testGenericParam() throws Exception {
@@ -11120,6 +11120,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
runTest("compiler/testData/codegen/box/dataClasses/floatParam.kt");
}
@Test
@TestMetadata("fromOtherModule.kt")
public void testFromOtherModule() throws Exception {
runTest("compiler/testData/codegen/box/dataClasses/fromOtherModule.kt");
}
@Test
@TestMetadata("genericParam.kt")
public void testGenericParam() throws Exception {
@@ -36,6 +36,12 @@ public class NativeKLibContentsTestGenerated extends AbstractNativeKlibContentsT
runTest("native/native.tests/testData/klibContents/annotations_source_retention.kt");
}
@Test
@TestMetadata("data_class.kt")
public void testData_class() throws Exception {
runTest("native/native.tests/testData/klibContents/data_class.kt");
}
@Test
@TestMetadata("kt55464_serializeTypeAnnotation.kt")
public void testKt55464_serializeTypeAnnotation() throws Exception {