Generate copy function for data classes

#KT-2779 Fixed
This commit is contained in:
Natalia.Ukhorskaya
2012-10-31 15:34:46 +04:00
parent 6009038342
commit 3b58eb4b60
20 changed files with 388 additions and 33 deletions
@@ -25,7 +25,7 @@ import java.io.File;
/** This class is generated by {@link org.jetbrains.jet.codegen.AbstractDataClassCodegenTest}. DO NOT MODIFY MANUALLY */
@TestMetadata("compiler/testData/codegen/dataClasses")
@InnerTestClasses({DataClassCodegenTestGenerated.Equals.class, DataClassCodegenTestGenerated.Hashcode.class, DataClassCodegenTestGenerated.Tostring.class})
@InnerTestClasses({DataClassCodegenTestGenerated.Copy.class, DataClassCodegenTestGenerated.Equals.class, DataClassCodegenTestGenerated.Hashcode.class, DataClassCodegenTestGenerated.Tostring.class})
public class DataClassCodegenTestGenerated extends AbstractDataClassCodegenTest {
public void testAllFilesPresentInDataClasses() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.codegen.AbstractDataClassCodegenTest", new File("compiler/testData/codegen/dataClasses"), "kt", true);
@@ -81,6 +81,40 @@ public class DataClassCodegenTestGenerated extends AbstractDataClassCodegenTest
blackBoxFileByFullPath("compiler/testData/codegen/dataClasses/unitComponent.kt");
}
@TestMetadata("compiler/testData/codegen/dataClasses/copy")
public static class Copy extends AbstractDataClassCodegenTest {
public void testAllFilesPresentInCopy() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.codegen.AbstractDataClassCodegenTest",
new File("compiler/testData/codegen/dataClasses/copy"), "kt", true);
}
@TestMetadata("constructorWithDefaultParam.kt")
public void testConstructorWithDefaultParam() throws Exception {
blackBoxFileByFullPath("compiler/testData/codegen/dataClasses/copy/constructorWithDefaultParam.kt");
}
@TestMetadata("paramWithoutProperty.kt")
public void testParamWithoutProperty() throws Exception {
blackBoxFileByFullPath("compiler/testData/codegen/dataClasses/copy/paramWithoutProperty.kt");
}
@TestMetadata("valInConstructorParams.kt")
public void testValInConstructorParams() throws Exception {
blackBoxFileByFullPath("compiler/testData/codegen/dataClasses/copy/valInConstructorParams.kt");
}
@TestMetadata("varInConstructorParams.kt")
public void testVarInConstructorParams() throws Exception {
blackBoxFileByFullPath("compiler/testData/codegen/dataClasses/copy/varInConstructorParams.kt");
}
@TestMetadata("withGenericParameter.kt")
public void testWithGenericParameter() throws Exception {
blackBoxFileByFullPath("compiler/testData/codegen/dataClasses/copy/withGenericParameter.kt");
}
}
@TestMetadata("compiler/testData/codegen/dataClasses/equals")
public static class Equals extends AbstractDataClassCodegenTest {
public void testAllFilesPresentInEquals() throws Exception {
@@ -243,6 +277,7 @@ public class DataClassCodegenTestGenerated extends AbstractDataClassCodegenTest
public static Test suite() {
TestSuite suite = new TestSuite("DataClassCodegenTestGenerated");
suite.addTestSuite(DataClassCodegenTestGenerated.class);
suite.addTestSuite(Copy.class);
suite.addTestSuite(Equals.class);
suite.addTestSuite(Hashcode.class);
suite.addTestSuite(Tostring.class);