From d71220f8b1e9c782dcd1274f27e8b86155cce8b1 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Thu, 11 Dec 2014 15:49:59 +0300 Subject: [PATCH] Drop ArrayGenTest, move test case to generated --- .../primitiveTypes/substituteIntForGeneric.kt | 8 +++++ .../jetbrains/jet/codegen/ArrayGenTest.java | 36 ------------------- .../BlackBoxCodegenTestGenerated.java | 6 ++++ 3 files changed, 14 insertions(+), 36 deletions(-) create mode 100644 compiler/testData/codegen/box/primitiveTypes/substituteIntForGeneric.kt delete mode 100644 compiler/tests/org/jetbrains/jet/codegen/ArrayGenTest.java diff --git a/compiler/testData/codegen/box/primitiveTypes/substituteIntForGeneric.kt b/compiler/testData/codegen/box/primitiveTypes/substituteIntForGeneric.kt new file mode 100644 index 00000000000..b057ebdfe21 --- /dev/null +++ b/compiler/testData/codegen/box/primitiveTypes/substituteIntForGeneric.kt @@ -0,0 +1,8 @@ +class L(var a: T) {} + +fun foo() = L(5).a + +fun box(): String { + val x: Any = foo() + return if (x is Integer) "OK" else "Fail $x" +} diff --git a/compiler/tests/org/jetbrains/jet/codegen/ArrayGenTest.java b/compiler/tests/org/jetbrains/jet/codegen/ArrayGenTest.java deleted file mode 100644 index c02e6455269..00000000000 --- a/compiler/tests/org/jetbrains/jet/codegen/ArrayGenTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.codegen; - -import org.jetbrains.jet.ConfigurationKind; - -import java.lang.reflect.Method; - -public class ArrayGenTest extends CodegenTestCase { - @Override - protected void setUp() throws Exception { - super.setUp(); - createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY); - } - - public void testIntGenerics() throws Exception { - loadText("class L(var a : T) {} fun foo() = L(5).a"); - Method foo = generateFunction(); - Object invoke = foo.invoke(null); - assertTrue(invoke instanceof Integer); - } -} diff --git a/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxCodegenTestGenerated.java index 444a61bdbfe..0d7a8a0f9aa 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxCodegenTestGenerated.java @@ -5619,6 +5619,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { doTest(fileName); } + @TestMetadata("substituteIntForGeneric.kt") + public void testSubstituteIntForGeneric() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/primitiveTypes/substituteIntForGeneric.kt"); + doTest(fileName); + } + @TestMetadata("unboxComparable.kt") public void testUnboxComparable() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/primitiveTypes/unboxComparable.kt");