toString() method for data classes and fake implementation for hashCode/equals

This commit is contained in:
Alex Tkachman
2012-09-16 15:56:48 +03:00
parent e317764a88
commit 58af365eb2
13 changed files with 236 additions and 40 deletions
@@ -13,23 +13,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.jet.codegen;
import junit.framework.Assert;
import junit.framework.Test;
import junit.framework.TestSuite;
import java.io.File;
import org.jetbrains.jet.JetTestUtils;
import org.jetbrains.jet.test.InnerTestClasses;
import org.jetbrains.jet.test.TestMetadata;
import org.jetbrains.jet.codegen.AbstractDataClassCodegenTest;
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.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", false);
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.codegen.AbstractDataClassCodegenTest", new File("compiler/testData/codegen/dataClasses"), "kt", true);
}
@TestMetadata("arrayParams.kt")
@@ -82,4 +82,49 @@ public class DataClassCodegenTestGenerated extends AbstractDataClassCodegenTest
blackBoxFileByFullPath("compiler/testData/codegen/dataClasses/unitComponent.kt");
}
@TestMetadata("compiler/testData/codegen/dataClasses/tostring")
public static class Tostring extends AbstractDataClassCodegenTest {
public void testAllFilesPresentInTostring() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.codegen.AbstractDataClassCodegenTest",
new File("compiler/testData/codegen/dataClasses/tostring"), "kt", true);
}
@TestMetadata("arrayParams.kt")
public void testArrayParams() throws Exception {
blackBoxFileByFullPath("compiler/testData/codegen/dataClasses/tostring/arrayParams.kt");
}
@TestMetadata("changingVarParam.kt")
public void testChangingVarParam() throws Exception {
blackBoxFileByFullPath("compiler/testData/codegen/dataClasses/tostring/changingVarParam.kt");
}
@TestMetadata("genericParam.kt")
public void testGenericParam() throws Exception {
blackBoxFileByFullPath("compiler/testData/codegen/dataClasses/tostring/genericParam.kt");
}
@TestMetadata("mixedParams.kt")
public void testMixedParams() throws Exception {
blackBoxFileByFullPath("compiler/testData/codegen/dataClasses/tostring/mixedParams.kt");
}
@TestMetadata("overriddenProperty.kt")
public void testOverriddenProperty() throws Exception {
blackBoxFileByFullPath("compiler/testData/codegen/dataClasses/tostring/overriddenProperty.kt");
}
@TestMetadata("unitComponent.kt")
public void testUnitComponent() throws Exception {
blackBoxFileByFullPath("compiler/testData/codegen/dataClasses/tostring/unitComponent.kt");
}
}
public static Test suite() {
TestSuite suite = new TestSuite("DataClassCodegenTestGenerated");
suite.addTestSuite(DataClassCodegenTestGenerated.class);
suite.addTestSuite(Tostring.class);
return suite;
}
}