Revert "enhance tests (mostly codegen)" temporarily
This reverts commit 95f9bcbacb.
This commit is contained in:
@@ -47,14 +47,8 @@ import java.util.List;
|
|||||||
public class JetCoreEnvironment extends JavaCoreEnvironment {
|
public class JetCoreEnvironment extends JavaCoreEnvironment {
|
||||||
private final List<JetFile> sourceFiles = new ArrayList<JetFile>();
|
private final List<JetFile> sourceFiles = new ArrayList<JetFile>();
|
||||||
|
|
||||||
@NotNull
|
|
||||||
private final CompilerDependencies compilerDependencies;
|
|
||||||
|
|
||||||
public JetCoreEnvironment(Disposable parentDisposable, @NotNull CompilerDependencies compilerDependencies) {
|
public JetCoreEnvironment(Disposable parentDisposable, @NotNull CompilerDependencies compilerDependencies) {
|
||||||
super(parentDisposable);
|
super(parentDisposable);
|
||||||
|
|
||||||
this.compilerDependencies = compilerDependencies;
|
|
||||||
|
|
||||||
registerFileType(JetFileType.INSTANCE, "kt");
|
registerFileType(JetFileType.INSTANCE, "kt");
|
||||||
registerFileType(JetFileType.INSTANCE, "kts");
|
registerFileType(JetFileType.INSTANCE, "kts");
|
||||||
registerFileType(JetFileType.INSTANCE, "ktm");
|
registerFileType(JetFileType.INSTANCE, "ktm");
|
||||||
@@ -156,9 +150,4 @@ public class JetCoreEnvironment extends JavaCoreEnvironment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
public CompilerDependencies getCompilerDependencies() {
|
|
||||||
return compilerDependencies;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class ArrayWrapper<T>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun get(index: Int): T {
|
fun get(index: Int): T {
|
||||||
return contents.get(index).sure()
|
return contents.get(index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class ArrayWrapper<T>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun get(index: Int): T {
|
fun get(index: Int): T {
|
||||||
return contents.get(index).sure()
|
return contents.get(index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class ArrayWrapper<T>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun get(index: Int): T {
|
fun get(index: Int): T {
|
||||||
return contents.get(index).sure()
|
return contents.get(index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class ArrayWrapper<T>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun get(index: Int): T {
|
fun get(index: Int): T {
|
||||||
return contents.get(index).sure()
|
return contents.get(index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,28 +19,28 @@ fun box() : String {
|
|||||||
val c1: java.lang.Iterable<Int> = MyCollection1()
|
val c1: java.lang.Iterable<Int> = MyCollection1()
|
||||||
sum = 0
|
sum = 0
|
||||||
for (el in c1) {
|
for (el in c1) {
|
||||||
sum = sum + el.sure()
|
sum = sum + el
|
||||||
}
|
}
|
||||||
if(sum != 15) return "c1 failed"
|
if(sum != 15) return "c1 failed"
|
||||||
|
|
||||||
val c2 = MyCollection1()
|
val c2 = MyCollection1()
|
||||||
sum = 0
|
sum = 0
|
||||||
for (el in c2) {
|
for (el in c2) {
|
||||||
sum = sum + el.sure()
|
sum = sum + el
|
||||||
}
|
}
|
||||||
if(sum != 15) return "c2 failed"
|
if(sum != 15) return "c2 failed"
|
||||||
|
|
||||||
val c3: Iterable<Int> = MyCollection2()
|
val c3: Iterable<Int> = MyCollection2()
|
||||||
sum = 0
|
sum = 0
|
||||||
for (el in c3) {
|
for (el in c3) {
|
||||||
sum = sum + el.sure()
|
sum = sum + el
|
||||||
}
|
}
|
||||||
if(sum != 15) return "c3 failed"
|
if(sum != 15) return "c3 failed"
|
||||||
|
|
||||||
val c4 = MyCollection2()
|
val c4 = MyCollection2()
|
||||||
sum = 0
|
sum = 0
|
||||||
for (el in c4) {
|
for (el in c4) {
|
||||||
sum = sum + el.sure()
|
sum = sum + el
|
||||||
}
|
}
|
||||||
if(sum != 15) return "c4 failed"
|
if(sum != 15) return "c4 failed"
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ fun box() : String {
|
|||||||
}
|
}
|
||||||
sum = 0
|
sum = 0
|
||||||
for (el in a) {
|
for (el in a) {
|
||||||
sum = sum + el.sure()
|
sum = sum + el
|
||||||
}
|
}
|
||||||
if(sum != 10) return "a failed"
|
if(sum != 10) return "a failed"
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ fun box() : String {
|
|||||||
val c7 = MyCollection5()
|
val c7 = MyCollection5()
|
||||||
sum = 0
|
sum = 0
|
||||||
for (el in c7) {
|
for (el in c7) {
|
||||||
sum = sum + el.sure()
|
sum = sum + el
|
||||||
}
|
}
|
||||||
if(sum != 0) return "c7 failed"
|
if(sum != 0) return "c7 failed"
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import java.util.ArrayList
|
||||||
|
|
||||||
class MyNumber(val i: Int) {
|
class MyNumber(val i: Int) {
|
||||||
fun inc(): MyNumber = MyNumber(i+1)
|
fun inc(): MyNumber = MyNumber(i+1)
|
||||||
}
|
}
|
||||||
@@ -50,26 +52,25 @@ fun test6() : Boolean {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyArrayList<T>(var value: T) {
|
|
||||||
fun get(index: Int): T {
|
|
||||||
if (index != 17)
|
|
||||||
throw Exception()
|
|
||||||
return value
|
|
||||||
}
|
|
||||||
fun set(index: Int, value: T): Unit {
|
|
||||||
if (index != 17)
|
|
||||||
throw Exception()
|
|
||||||
this.value = value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun test7() : Boolean {
|
fun test7() : Boolean {
|
||||||
var mnr = MyArrayList<MyNumber>(MyNumber(42))
|
var mnr = ArrayList<MyNumber>()
|
||||||
mnr[17]++
|
mnr.add(MyNumber(42))
|
||||||
if (mnr[17].i != 43) return false
|
mnr[0]++
|
||||||
|
if (mnr[0].i != 43) return false
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun test8() : Boolean {
|
||||||
|
var mnr = ArrayList<MyNumber>()
|
||||||
|
mnr.add(MyNumber(42))
|
||||||
|
mnr.add(MyNumber(41))
|
||||||
|
mnr[1] = mnr[0]++
|
||||||
|
if (mnr[0].i != 43) return false
|
||||||
|
if (mnr[1].i != 42) return false
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fun box() : String {
|
fun box() : String {
|
||||||
var m = MyNumber(42)
|
var m = MyNumber(42)
|
||||||
|
|
||||||
@@ -81,6 +82,7 @@ fun box() : String {
|
|||||||
if (!test5()) return "fail test 5"
|
if (!test5()) return "fail test 5"
|
||||||
if (!test6()) return "fail test 6"
|
if (!test6()) return "fail test 6"
|
||||||
if (!test7()) return "fail test 7"
|
if (!test7()) return "fail test 7"
|
||||||
|
if (!test8()) return "fail test 8"
|
||||||
|
|
||||||
|
|
||||||
++m
|
++m
|
||||||
|
|||||||
@@ -14,5 +14,5 @@ var <T> ArrayList<T>.length : Int
|
|||||||
set(value: Int) = throw java.lang.Error()
|
set(value: Int) = throw java.lang.Error()
|
||||||
|
|
||||||
var <T> ArrayList<T>.last : T
|
var <T> ArrayList<T>.last : T
|
||||||
get() = get(size()-1).sure()
|
get() = get(size()-1)
|
||||||
set(el : T) { set(size()-1, el) }
|
set(el : T) { set(size()-1, el) }
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import java.util.ArrayList
|
import java.util.ArrayList
|
||||||
|
|
||||||
class N() : ArrayList<Any>() {
|
class N() : ArrayList<Any>() {
|
||||||
override fun add(el: Any?) : Boolean {
|
override fun add(el: Any) : Boolean {
|
||||||
if (!super<ArrayList>.add(el)) {
|
if (!super<ArrayList>.add(el)) {
|
||||||
throw Exception()
|
throw Exception()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,10 +30,8 @@ import com.intellij.testFramework.LightVirtualFile;
|
|||||||
import com.intellij.testFramework.TestDataFile;
|
import com.intellij.testFramework.TestDataFile;
|
||||||
import com.intellij.testFramework.UsefulTestCase;
|
import com.intellij.testFramework.UsefulTestCase;
|
||||||
import org.jetbrains.annotations.NonNls;
|
import org.jetbrains.annotations.NonNls;
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
||||||
import org.jetbrains.jet.lang.psi.JetFile;
|
import org.jetbrains.jet.lang.psi.JetFile;
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
import org.jetbrains.jet.plugin.JetLanguage;
|
import org.jetbrains.jet.plugin.JetLanguage;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -67,26 +65,14 @@ public abstract class JetLiteFixture extends UsefulTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
|
createEnvironmentWithMockJdk();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createEnvironmentWithMockJdk() {
|
protected void createEnvironmentWithMockJdk() {
|
||||||
if (myEnvironment != null) {
|
|
||||||
throw new IllegalStateException("must not set up myEnvironemnt twice");
|
|
||||||
}
|
|
||||||
myEnvironment = JetTestUtils.createEnvironmentWithMockJdk(getTestRootDisposable());
|
myEnvironment = JetTestUtils.createEnvironmentWithMockJdk(getTestRootDisposable());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createEnvironmentWithMockJdk(@NotNull CompilerSpecialMode compilerSpecialMode) {
|
|
||||||
if (myEnvironment != null) {
|
|
||||||
throw new IllegalStateException("must not set up myEnvironemnt twice");
|
|
||||||
}
|
|
||||||
myEnvironment = JetTestUtils.createEnvironmentWithMockJdk(getTestRootDisposable(), compilerSpecialMode);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void createEnvironmentWithFullJdk() {
|
protected void createEnvironmentWithFullJdk() {
|
||||||
if (myEnvironment != null) {
|
|
||||||
throw new IllegalStateException("must not set up myEnvironemnt twice");
|
|
||||||
}
|
|
||||||
myEnvironment = JetTestUtils.createEnvironmentWithFullJdk(getTestRootDisposable());
|
myEnvironment = JetTestUtils.createEnvironmentWithFullJdk(getTestRootDisposable());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import org.jetbrains.jet.JetTestUtils;
|
|||||||
import org.jetbrains.jet.lang.cfg.LoopInfo;
|
import org.jetbrains.jet.lang.cfg.LoopInfo;
|
||||||
import org.jetbrains.jet.lang.cfg.pseudocode.*;
|
import org.jetbrains.jet.lang.cfg.pseudocode.*;
|
||||||
import org.jetbrains.jet.lang.psi.*;
|
import org.jetbrains.jet.lang.psi.*;
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
@@ -51,13 +50,6 @@ public class JetControlFlowTest extends JetLiteFixture {
|
|||||||
myName = name;
|
myName = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.STDLIB);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "test" + myName;
|
return "test" + myName;
|
||||||
|
|||||||
@@ -40,13 +40,6 @@ public class CheckerTestUtilTest extends JetLiteFixture {
|
|||||||
super("diagnostics/checkerTestUtil");
|
super("diagnostics/checkerTestUtil");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
createEnvironmentWithMockJdk();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
protected void doTest(TheTest theTest) throws Exception {
|
protected void doTest(TheTest theTest) throws Exception {
|
||||||
prepareForTest("test");
|
prepareForTest("test");
|
||||||
theTest.test(myFile);
|
theTest.test(myFile);
|
||||||
|
|||||||
@@ -54,12 +54,6 @@ public class JetDiagnosticsTest extends JetLiteFixture {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.STDLIB);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "test" + name;
|
return "test" + name;
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import jet.JetObject;
|
import jet.JetObject;
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
import java.lang.annotation.*;
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
@@ -25,13 +24,6 @@ import java.lang.reflect.InvocationTargetException;
|
|||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
public class AnnotationGenTest extends CodegenTestCase {
|
public class AnnotationGenTest extends CodegenTestCase {
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testPropField() throws NoSuchFieldException, NoSuchMethodException {
|
public void testPropField() throws NoSuchFieldException, NoSuchMethodException {
|
||||||
loadText("[Deprecated] var x = 0");
|
loadText("[Deprecated] var x = 0");
|
||||||
Class aClass = generateNamespaceClass();
|
Class aClass = generateNamespaceClass();
|
||||||
|
|||||||
@@ -16,18 +16,9 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
public class ArrayGenTest extends CodegenTestCase {
|
public class ArrayGenTest extends CodegenTestCase {
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testKt238 () throws Exception {
|
public void testKt238 () throws Exception {
|
||||||
blackBoxFile("regressions/kt238.jet");
|
blackBoxFile("regressions/kt238.jet");
|
||||||
}
|
}
|
||||||
@@ -246,7 +237,7 @@ public class ArrayGenTest extends CodegenTestCase {
|
|||||||
public void testCollectionAssignGetMultiIndex () throws Exception {
|
public void testCollectionAssignGetMultiIndex () throws Exception {
|
||||||
loadText("import java.util.ArrayList\n" +
|
loadText("import java.util.ArrayList\n" +
|
||||||
"fun box() : String { val s = ArrayList<String>(1); s.add(\"\"); s [1, -1] = \"5\"; s[2, -2] += \"7\"; return s[2,-2] }\n" +
|
"fun box() : String { val s = ArrayList<String>(1); s.add(\"\"); s [1, -1] = \"5\"; s[2, -2] += \"7\"; return s[2,-2] }\n" +
|
||||||
"fun ArrayList<String>.get(index1: Int, index2 : Int) = this[index1+index2].sure()\n" +
|
"fun ArrayList<String>.get(index1: Int, index2 : Int) = this[index1+index2]\n" +
|
||||||
"fun ArrayList<String>.set(index1: Int, index2 : Int, elem: String) { this[index1+index2] = elem }\n");
|
"fun ArrayList<String>.set(index1: Int, index2 : Int, elem: String) { this[index1+index2] = elem }\n");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
Method foo = generateFunction("box");
|
Method foo = generateFunction("box");
|
||||||
@@ -266,7 +257,7 @@ public class ArrayGenTest extends CodegenTestCase {
|
|||||||
public void testCollectionGetMultiIndex () throws Exception {
|
public void testCollectionGetMultiIndex () throws Exception {
|
||||||
loadText("import java.util.ArrayList\n" +
|
loadText("import java.util.ArrayList\n" +
|
||||||
"fun box() : String { val s = ArrayList<String>(1); s.add(\"\"); s [1, -1] = \"5\"; return s[2, -2] }\n" +
|
"fun box() : String { val s = ArrayList<String>(1); s.add(\"\"); s [1, -1] = \"5\"; return s[2, -2] }\n" +
|
||||||
"fun ArrayList<String>.get(index1: Int, index2 : Int) = this[index1+index2].sure()\n" +
|
"fun ArrayList<String>.get(index1: Int, index2 : Int) = this[index1+index2]\n" +
|
||||||
"fun ArrayList<String>.set(index1: Int, index2 : Int, elem: String) { this[index1+index2] = elem }\n");
|
"fun ArrayList<String>.set(index1: Int, index2 : Int, elem: String) { this[index1+index2] = elem }\n");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
Method foo = generateFunction("box");
|
Method foo = generateFunction("box");
|
||||||
|
|||||||
@@ -16,11 +16,8 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
public class BridgeMethodGenTest extends CodegenTestCase {
|
public class BridgeMethodGenTest extends CodegenTestCase {
|
||||||
public void testBridgeMethod () throws Exception {
|
public void testBridgeMethod () throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("bridge.jet");
|
blackBoxFile("bridge.jet");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.lang.reflect.Modifier;
|
import java.lang.reflect.Modifier;
|
||||||
@@ -28,14 +26,7 @@ import java.util.List;
|
|||||||
* @author alex.tkachman
|
* @author alex.tkachman
|
||||||
*/
|
*/
|
||||||
public class ClassGenTest extends CodegenTestCase {
|
public class ClassGenTest extends CodegenTestCase {
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testPSVMClass() throws Exception {
|
public void testPSVMClass() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile("classes/simpleClass.jet");
|
loadFile("classes/simpleClass.jet");
|
||||||
|
|
||||||
final Class aClass = loadClass("SimpleClass", generateClassesInFile());
|
final Class aClass = loadClass("SimpleClass", generateClassesInFile());
|
||||||
@@ -46,7 +37,6 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testArrayListInheritance() throws Exception {
|
public void testArrayListInheritance() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile("classes/inheritingFromArrayList.jet");
|
loadFile("classes/inheritingFromArrayList.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Class aClass = loadClass("Foo", generateClassesInFile());
|
final Class aClass = loadClass("Foo", generateClassesInFile());
|
||||||
@@ -54,37 +44,30 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testInheritanceAndDelegation_DelegatingDefaultConstructorProperties() throws Exception {
|
public void testInheritanceAndDelegation_DelegatingDefaultConstructorProperties() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/inheritance.jet");
|
blackBoxFile("classes/inheritance.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testInheritanceAndDelegation2() throws Exception {
|
public void testInheritanceAndDelegation2() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/delegation2.kt");
|
blackBoxFile("classes/delegation2.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testFunDelegation() throws Exception {
|
public void testFunDelegation() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/funDelegation.jet");
|
blackBoxFile("classes/funDelegation.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testPropertyDelegation() throws Exception {
|
public void testPropertyDelegation() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/propertyDelegation.jet");
|
blackBoxFile("classes/propertyDelegation.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testDiamondInheritance() throws Exception {
|
public void testDiamondInheritance() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/diamondInheritance.jet");
|
blackBoxFile("classes/diamondInheritance.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testRightHandOverride() throws Exception {
|
public void testRightHandOverride() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/rightHandOverride.jet");
|
blackBoxFile("classes/rightHandOverride.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNewInstanceExplicitConstructor() throws Exception {
|
public void testNewInstanceExplicitConstructor() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile("classes/newInstanceDefaultConstructor.jet");
|
loadFile("classes/newInstanceDefaultConstructor.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method method = generateFunction("test");
|
final Method method = generateFunction("test");
|
||||||
@@ -93,22 +76,18 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testInnerClass() throws Exception {
|
public void testInnerClass() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/innerClass.jet");
|
blackBoxFile("classes/innerClass.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testInheritedInnerClass() throws Exception {
|
public void testInheritedInnerClass() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/inheritedInnerClass.jet");
|
blackBoxFile("classes/inheritedInnerClass.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testInitializerBlock() throws Exception {
|
public void testInitializerBlock() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/initializerBlock.jet");
|
blackBoxFile("classes/initializerBlock.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testAbstractMethod() throws Exception {
|
public void testAbstractMethod() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("abstract class Foo { abstract fun x(): String; fun y(): Int = 0 }");
|
loadText("abstract class Foo { abstract fun x(): String; fun y(): Int = 0 }");
|
||||||
|
|
||||||
final ClassFileFactory codegens = generateClassesInFile();
|
final ClassFileFactory codegens = generateClassesInFile();
|
||||||
@@ -118,42 +97,34 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testInheritedMethod() throws Exception {
|
public void testInheritedMethod() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/inheritedMethod.jet");
|
blackBoxFile("classes/inheritedMethod.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testInitializerBlockDImpl() throws Exception {
|
public void testInitializerBlockDImpl() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/initializerBlockDImpl.jet");
|
blackBoxFile("classes/initializerBlockDImpl.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testPropertyInInitializer() throws Exception {
|
public void testPropertyInInitializer() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/propertyInInitializer.jet");
|
blackBoxFile("classes/propertyInInitializer.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testOuterThis() throws Exception {
|
public void testOuterThis() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/outerThis.jet");
|
blackBoxFile("classes/outerThis.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSecondaryConstructors() throws Exception {
|
public void testSecondaryConstructors() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/secondaryConstructors.jet");
|
blackBoxFile("classes/secondaryConstructors.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testExceptionConstructor() throws Exception {
|
public void testExceptionConstructor() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/exceptionConstructor.jet");
|
blackBoxFile("classes/exceptionConstructor.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSimpleBox() throws Exception {
|
public void testSimpleBox() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/simpleBox.jet");
|
blackBoxFile("classes/simpleBox.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testAbstractClass() throws Exception {
|
public void testAbstractClass() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("abstract class SimpleClass() { }");
|
loadText("abstract class SimpleClass() { }");
|
||||||
|
|
||||||
final Class aClass = createClassLoader(generateClassesInFile()).loadClass("SimpleClass");
|
final Class aClass = createClassLoader(generateClassesInFile()).loadClass("SimpleClass");
|
||||||
@@ -161,18 +132,15 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testClassObject() throws Exception {
|
public void testClassObject() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/classObject.jet");
|
blackBoxFile("classes/classObject.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testClassObjectMethod() throws Exception {
|
public void testClassObjectMethod() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
// todo to be implemented after removal of type info
|
// todo to be implemented after removal of type info
|
||||||
// blackBoxFile("classes/classObjectMethod.jet");
|
// blackBoxFile("classes/classObjectMethod.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testClassObjectInterface() throws Exception {
|
public void testClassObjectInterface() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile("classes/classObjectInterface.jet");
|
loadFile("classes/classObjectInterface.jet");
|
||||||
final Method method = generateFunction();
|
final Method method = generateFunction();
|
||||||
Object result = method.invoke(null);
|
Object result = method.invoke(null);
|
||||||
@@ -180,32 +148,26 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testOverloadBinaryOperator() throws Exception {
|
public void testOverloadBinaryOperator() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/overloadBinaryOperator.jet");
|
blackBoxFile("classes/overloadBinaryOperator.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testOverloadUnaryOperator() throws Exception {
|
public void testOverloadUnaryOperator() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/overloadUnaryOperator.jet");
|
blackBoxFile("classes/overloadUnaryOperator.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testOverloadPlusAssign() throws Exception {
|
public void testOverloadPlusAssign() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/overloadPlusAssign.jet");
|
blackBoxFile("classes/overloadPlusAssign.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testOverloadPlusAssignReturn() throws Exception {
|
public void testOverloadPlusAssignReturn() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/overloadPlusAssignReturn.jet");
|
blackBoxFile("classes/overloadPlusAssignReturn.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testOverloadPlusToPlusAssign() throws Exception {
|
public void testOverloadPlusToPlusAssign() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/overloadPlusToPlusAssign.jet");
|
blackBoxFile("classes/overloadPlusToPlusAssign.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testEnumClass() throws Exception {
|
public void testEnumClass() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("enum class Direction { NORTH; SOUTH; EAST; WEST }");
|
loadText("enum class Direction { NORTH; SOUTH; EAST; WEST }");
|
||||||
final Class direction = createClassLoader(generateClassesInFile()).loadClass("Direction");
|
final Class direction = createClassLoader(generateClassesInFile()).loadClass("Direction");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
@@ -215,7 +177,6 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testEnumConstantConstructors() throws Exception {
|
public void testEnumConstantConstructors() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("enum class Color(val rgb: Int) { RED: Color(0xFF0000); GREEN: Color(0x00FF00); }");
|
loadText("enum class Color(val rgb: Int) { RED: Color(0xFF0000); GREEN: Color(0x00FF00); }");
|
||||||
final Class colorClass = createClassLoader(generateClassesInFile()).loadClass("Color");
|
final Class colorClass = createClassLoader(generateClassesInFile()).loadClass("Color");
|
||||||
final Field redField = colorClass.getField("RED");
|
final Field redField = colorClass.getField("RED");
|
||||||
@@ -225,25 +186,21 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testClassObjFields() throws Exception {
|
public void testClassObjFields() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("class A() { class object { val value = 10 } }\n" +
|
loadText("class A() { class object { val value = 10 } }\n" +
|
||||||
"fun box() = if(A.value == 10) \"OK\" else \"fail\"");
|
"fun box() = if(A.value == 10) \"OK\" else \"fail\"");
|
||||||
blackBox();
|
blackBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt249() throws Exception {
|
public void testKt249() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt249.jet");
|
blackBoxFile("regressions/kt249.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt48 () throws Exception {
|
public void testKt48 () throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt48.jet");
|
blackBoxFile("regressions/kt48.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt309 () throws Exception {
|
public void testKt309 () throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("fun box() = null");
|
loadText("fun box() = null");
|
||||||
final Method method = generateFunction("box");
|
final Method method = generateFunction("box");
|
||||||
assertEquals(method.getReturnType().getName(), "java.lang.Object");
|
assertEquals(method.getReturnType().getName(), "java.lang.Object");
|
||||||
@@ -251,73 +208,60 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt343 () throws Exception {
|
public void testKt343 () throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt343.jet");
|
blackBoxFile("regressions/kt343.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt508 () throws Exception {
|
public void testKt508 () throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile("regressions/kt508.jet");
|
loadFile("regressions/kt508.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
blackBox();
|
blackBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt504 () throws Exception {
|
public void testKt504 () throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile("regressions/kt504.jet");
|
loadFile("regressions/kt504.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
blackBox();
|
blackBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt501 () throws Exception {
|
public void testKt501 () throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt501.jet");
|
blackBoxFile("regressions/kt501.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt496 () throws Exception {
|
public void testKt496 () throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt496.jet");
|
blackBoxFile("regressions/kt496.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt500 () throws Exception {
|
public void testKt500 () throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt500.jet");
|
blackBoxFile("regressions/kt500.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt694 () throws Exception {
|
public void testKt694 () throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
// blackBoxFile("regressions/kt694.jet");
|
// blackBoxFile("regressions/kt694.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt285 () throws Exception {
|
public void testKt285 () throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
// blackBoxFile("regressions/kt285.jet");
|
// blackBoxFile("regressions/kt285.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt707 () throws Exception {
|
public void testKt707 () throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt707.jet");
|
blackBoxFile("regressions/kt707.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt857 () throws Exception {
|
public void testKt857 () throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
// blackBoxFile("regressions/kt857.jet");
|
// blackBoxFile("regressions/kt857.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt903 () throws Exception {
|
public void testKt903 () throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt903.jet");
|
blackBoxFile("regressions/kt903.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt940 () throws Exception {
|
public void testKt940 () throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt940.kt");
|
blackBoxFile("regressions/kt940.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1018 () throws Exception {
|
public void testKt1018 () throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt1018.kt");
|
blackBoxFile("regressions/kt1018.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -332,58 +276,47 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1134() throws Exception {
|
public void testKt1134() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt1134.kt");
|
blackBoxFile("regressions/kt1134.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1157() throws Exception {
|
public void testKt1157() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt1157.kt");
|
blackBoxFile("regressions/kt1157.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt471() throws Exception {
|
public void testKt471() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt471.kt");
|
blackBoxFile("regressions/kt471.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1213() throws Exception {
|
public void testKt1213() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
// blackBoxFile("regressions/kt1213.kt");
|
// blackBoxFile("regressions/kt1213.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt723() throws Exception {
|
public void testKt723() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt723.kt");
|
blackBoxFile("regressions/kt723.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt725() throws Exception {
|
public void testKt725() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt725.kt");
|
blackBoxFile("regressions/kt725.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt633() throws Exception {
|
public void testKt633() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt633.kt");
|
blackBoxFile("regressions/kt633.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void testKt1345() throws Exception {
|
public void testKt1345() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt1345.kt");
|
blackBoxFile("regressions/kt1345.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1538() throws Exception {
|
public void testKt1538() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt1538.kt");
|
blackBoxFile("regressions/kt1538.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1759() throws Exception {
|
public void testKt1759() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt1759.kt");
|
blackBoxFile("regressions/kt1759.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testResolveOrder() throws Exception {
|
public void testResolveOrder() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("classes/resolveOrder.jet");
|
blackBoxFile("classes/resolveOrder.jet");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,19 +16,10 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author max
|
* @author max
|
||||||
*/
|
*/
|
||||||
public class ClosuresGenTest extends CodegenTestCase {
|
public class ClosuresGenTest extends CodegenTestCase {
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testSimplestClosure() throws Exception {
|
public void testSimplestClosure() throws Exception {
|
||||||
blackBoxFile("classes/simplestClosure.jet");
|
blackBoxFile("classes/simplestClosure.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import org.jetbrains.jet.analyzer.AnalyzeExhaust;
|
|||||||
import org.jetbrains.jet.lang.cfg.pseudocode.JetControlFlowDataTraceFactory;
|
import org.jetbrains.jet.lang.cfg.pseudocode.JetControlFlowDataTraceFactory;
|
||||||
import org.jetbrains.jet.lang.psi.JetFile;
|
import org.jetbrains.jet.lang.psi.JetFile;
|
||||||
import org.jetbrains.jet.lang.psi.JetPsiUtil;
|
import org.jetbrains.jet.lang.psi.JetPsiUtil;
|
||||||
import org.jetbrains.jet.lang.resolve.AnalyzingUtils;
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM;
|
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM;
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
||||||
import org.jetbrains.jet.parsing.JetParsingTest;
|
import org.jetbrains.jet.parsing.JetParsingTest;
|
||||||
@@ -128,9 +127,8 @@ public abstract class CodegenTestCase extends JetLiteFixture {
|
|||||||
private GenerationState generateCommon(ClassBuilderFactory classBuilderFactory) {
|
private GenerationState generateCommon(ClassBuilderFactory classBuilderFactory) {
|
||||||
final AnalyzeExhaust analyzeExhaust = AnalyzerFacadeForJVM.analyzeOneFileWithJavaIntegrationAndCheckForErrors(
|
final AnalyzeExhaust analyzeExhaust = AnalyzerFacadeForJVM.analyzeOneFileWithJavaIntegrationAndCheckForErrors(
|
||||||
myFile, JetControlFlowDataTraceFactory.EMPTY,
|
myFile, JetControlFlowDataTraceFactory.EMPTY,
|
||||||
myEnvironment.getCompilerDependencies());
|
CompileCompilerDependenciesTest.compilerDependenciesForTests(CompilerSpecialMode.REGULAR, false));
|
||||||
analyzeExhaust.throwIfError();
|
analyzeExhaust.throwIfError();
|
||||||
AnalyzingUtils.throwExceptionOnErrors(analyzeExhaust.getBindingContext());
|
|
||||||
GenerationState state = new GenerationState(getProject(), classBuilderFactory, analyzeExhaust, Collections.singletonList(myFile));
|
GenerationState state = new GenerationState(getProject(), classBuilderFactory, analyzeExhaust, Collections.singletonList(myFile));
|
||||||
state.compileCorrectFiles(CompilationErrorHandler.THROW_EXCEPTION);
|
state.compileCorrectFiles(CompilationErrorHandler.THROW_EXCEPTION);
|
||||||
return state;
|
return state;
|
||||||
@@ -196,7 +194,8 @@ public abstract class CodegenTestCase extends JetLiteFixture {
|
|||||||
|
|
||||||
r = method;
|
r = method;
|
||||||
}
|
}
|
||||||
if (r == null) { throw new AssertionError(); }
|
if (r == null)
|
||||||
|
throw new AssertionError();
|
||||||
return r;
|
return r;
|
||||||
} catch (Error e) {
|
} catch (Error e) {
|
||||||
System.out.println(generateToText());
|
System.out.println(generateToText());
|
||||||
|
|||||||
@@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -33,7 +31,6 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testIf() throws Exception {
|
public void testIf() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile();
|
loadFile();
|
||||||
|
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
@@ -43,7 +40,6 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testSingleBranchIf() throws Exception {
|
public void testSingleBranchIf() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile();
|
loadFile();
|
||||||
|
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
@@ -65,7 +61,6 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void factorialTest(final String name) throws IllegalAccessException, InvocationTargetException {
|
private void factorialTest(final String name) throws IllegalAccessException, InvocationTargetException {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile(name);
|
loadFile(name);
|
||||||
|
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
@@ -75,7 +70,6 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testContinue() throws Exception {
|
public void testContinue() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile();
|
loadFile();
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
@@ -84,7 +78,6 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testIfNoElse() throws Exception {
|
public void testIfNoElse() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile();
|
loadFile();
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
@@ -93,7 +86,6 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testCondJumpOnStack() throws Exception {
|
public void testCondJumpOnStack() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("import java.lang.Boolean as jlBoolean; fun foo(a: String): Int = if (jlBoolean.parseBoolean(a)) 5 else 10");
|
loadText("import java.lang.Boolean as jlBoolean; fun foo(a: String): Int = if (jlBoolean.parseBoolean(a)) 5 else 10");
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
assertEquals(5, main.invoke(null, "true"));
|
assertEquals(5, main.invoke(null, "true"));
|
||||||
@@ -101,7 +93,6 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testFor() throws Exception {
|
public void testFor() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile();
|
loadFile();
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
@@ -110,7 +101,6 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testIfBlock() throws Exception {
|
public void testIfBlock() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile();
|
loadFile();
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
@@ -121,7 +111,6 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testForInArray() throws Exception {
|
public void testForInArray() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile();
|
loadFile();
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
@@ -130,7 +119,6 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testForInRange() throws Exception {
|
public void testForInRange() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("fun foo(sb: StringBuilder) { for(x in 1..4) sb.append(x) }");
|
loadText("fun foo(sb: StringBuilder) { for(x in 1..4) sb.append(x) }");
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
@@ -139,7 +127,6 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testThrowCheckedException() throws Exception {
|
public void testThrowCheckedException() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("fun foo() { throw Exception(); }");
|
loadText("fun foo() { throw Exception(); }");
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
boolean caught = false;
|
boolean caught = false;
|
||||||
@@ -154,7 +141,6 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testTryCatch() throws Exception {
|
public void testTryCatch() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile();
|
loadFile();
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
@@ -163,7 +149,6 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testTryFinally() throws Exception {
|
public void testTryFinally() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile();
|
loadFile();
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
@@ -183,37 +168,30 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testForUserType() throws Exception {
|
public void testForUserType() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("controlStructures/forUserType.jet");
|
blackBoxFile("controlStructures/forUserType.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testForIntArray() throws Exception {
|
public void testForIntArray() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("controlStructures/forIntArray.jet");
|
blackBoxFile("controlStructures/forIntArray.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testForPrimitiveIntArray() throws Exception {
|
public void testForPrimitiveIntArray() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("controlStructures/forPrimitiveIntArray.jet");
|
blackBoxFile("controlStructures/forPrimitiveIntArray.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testForNullableIntArray() throws Exception {
|
public void testForNullableIntArray() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("controlStructures/forNullableIntArray.jet");
|
blackBoxFile("controlStructures/forNullableIntArray.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testForIntRange() {
|
public void testForIntRange() {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("controlStructures/forIntRange.jet");
|
blackBoxFile("controlStructures/forIntRange.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt237() throws Exception {
|
public void testKt237() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt237.jet");
|
blackBoxFile("regressions/kt237.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testCompareToNull() throws Exception {
|
public void testCompareToNull() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("fun foo(a: String?, b: String?): Boolean = a == null && b !== null && null == a && null !== b");
|
loadText("fun foo(a: String?, b: String?): Boolean = a == null && b !== null && null == a && null !== b");
|
||||||
String text = generateToText();
|
String text = generateToText();
|
||||||
assertTrue(!text.contains("java/lang/Object.equals"));
|
assertTrue(!text.contains("java/lang/Object.equals"));
|
||||||
@@ -224,7 +202,6 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testCompareToNonnullableEq() throws Exception {
|
public void testCompareToNonnullableEq() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("fun foo(a: String?, b: String): Boolean = a == b || b == a");
|
loadText("fun foo(a: String?, b: String): Boolean = a == b || b == a");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
@@ -233,7 +210,6 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testCompareToNonnullableNotEq() throws Exception {
|
public void testCompareToNonnullableNotEq() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("fun foo(a: String?, b: String): Boolean = a != b");
|
loadText("fun foo(a: String?, b: String): Boolean = a != b");
|
||||||
String text = generateToText();
|
String text = generateToText();
|
||||||
// System.out.println(text);
|
// System.out.println(text);
|
||||||
@@ -244,18 +220,15 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt299() throws Exception {
|
public void testKt299() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt299.jet");
|
blackBoxFile("regressions/kt299.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt416() throws Exception {
|
public void testKt416() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt416.jet");
|
blackBoxFile("regressions/kt416.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt513() throws Exception {
|
public void testKt513() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt513.jet");
|
blackBoxFile("regressions/kt513.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,37 +238,31 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt769() throws Exception {
|
public void testKt769() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt769.jet");
|
blackBoxFile("regressions/kt769.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt773() throws Exception {
|
public void testKt773() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt773.jet");
|
blackBoxFile("regressions/kt773.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt772() throws Exception {
|
public void testKt772() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt772.jet");
|
blackBoxFile("regressions/kt772.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt870() throws Exception {
|
public void testKt870() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt870.jet");
|
blackBoxFile("regressions/kt870.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt958() throws Exception {
|
public void testKt958() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt958.jet");
|
blackBoxFile("regressions/kt958.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testQuicksort() throws Exception {
|
public void testQuicksort() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("controlStructures/quicksort.jet");
|
blackBoxFile("controlStructures/quicksort.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
@@ -313,22 +280,18 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1076() throws Exception {
|
public void testKt1076() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt1076.kt");
|
blackBoxFile("regressions/kt1076.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt998() throws Exception {
|
public void testKt998() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt998.kt");
|
blackBoxFile("regressions/kt998.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt628() throws Exception {
|
public void testKt628() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt628.kt");
|
blackBoxFile("regressions/kt628.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1441() throws Exception {
|
public void testKt1441() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt1441.kt");
|
blackBoxFile("regressions/kt1441.kt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,7 +29,6 @@ public class ExtensionFunctionsTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile();
|
loadFile();
|
||||||
final Method foo = generateFunction("foo");
|
final Method foo = generateFunction("foo");
|
||||||
final Character c = (Character) foo.invoke(null);
|
final Character c = (Character) foo.invoke(null);
|
||||||
@@ -39,7 +36,6 @@ public class ExtensionFunctionsTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testWhenFail() throws Exception {
|
public void testWhenFail() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile();
|
loadFile();
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
Method foo = generateFunction("foo");
|
Method foo = generateFunction("foo");
|
||||||
@@ -47,18 +43,15 @@ public class ExtensionFunctionsTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testVirtual() throws Exception {
|
public void testVirtual() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("extensionFunctions/virtual.jet");
|
blackBoxFile("extensionFunctions/virtual.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testShared() throws Exception {
|
public void testShared() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("extensionFunctions/shared.kt");
|
blackBoxFile("extensionFunctions/shared.kt");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt475() throws Exception {
|
public void testKt475() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt475.jet");
|
blackBoxFile("regressions/kt475.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
@@ -25,12 +23,6 @@ import java.lang.reflect.Method;
|
|||||||
* @author alex.tkachman
|
* @author alex.tkachman
|
||||||
*/
|
*/
|
||||||
public class FunctionGenTest extends CodegenTestCase {
|
public class FunctionGenTest extends CodegenTestCase {
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testDefaultArgs() throws Exception {
|
public void testDefaultArgs() throws Exception {
|
||||||
blackBoxFile("functions/defaultargs.jet");
|
blackBoxFile("functions/defaultargs.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ package org.jetbrains.jet.codegen;
|
|||||||
import jet.IntRange;
|
import jet.IntRange;
|
||||||
import jet.Tuple2;
|
import jet.Tuple2;
|
||||||
import jet.Tuple4;
|
import jet.Tuple4;
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
@@ -31,13 +30,6 @@ import java.util.Arrays;
|
|||||||
* @author yole
|
* @author yole
|
||||||
*/
|
*/
|
||||||
public class NamespaceGenTest extends CodegenTestCase {
|
public class NamespaceGenTest extends CodegenTestCase {
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testPSVM() throws Exception {
|
public void testPSVM() throws Exception {
|
||||||
loadFile("PSVM.jet");
|
loadFile("PSVM.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
|
|||||||
@@ -16,19 +16,11 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author yole
|
* @author yole
|
||||||
* @author alex.tkachman
|
* @author alex.tkachman
|
||||||
*/
|
*/
|
||||||
public class ObjectGenTest extends CodegenTestCase {
|
public class ObjectGenTest extends CodegenTestCase {
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testSimpleObject() throws Exception {
|
public void testSimpleObject() throws Exception {
|
||||||
blackBoxFile("objects/simpleObject.jet");
|
blackBoxFile("objects/simpleObject.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import jet.Tuple2;
|
import jet.Tuple2;
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
@@ -25,13 +24,6 @@ import java.lang.reflect.Method;
|
|||||||
* @author yole
|
* @author yole
|
||||||
*/
|
*/
|
||||||
public class PatternMatchingTest extends CodegenTestCase {
|
public class PatternMatchingTest extends CodegenTestCase {
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getPrefix() {
|
protected String getPrefix() {
|
||||||
return "patternMatching";
|
return "patternMatching";
|
||||||
|
|||||||
@@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,13 +23,6 @@ import java.lang.reflect.Method;
|
|||||||
* @author alex.tkachman
|
* @author alex.tkachman
|
||||||
*/
|
*/
|
||||||
public class PrimitiveTypesTest extends CodegenTestCase {
|
public class PrimitiveTypesTest extends CodegenTestCase {
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testPlus() throws Exception {
|
public void testPlus() throws Exception {
|
||||||
loadText("fun f(a: Int, b: Int): Int { return a + b }");
|
loadText("fun f(a: Int, b: Int): Int { return a + b }");
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
@@ -33,7 +31,6 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testPrivateVal() throws Exception {
|
public void testPrivateVal() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile();
|
loadFile();
|
||||||
final Class aClass = loadImplementationClass(generateClassesInFile(), "PrivateVal");
|
final Class aClass = loadImplementationClass(generateClassesInFile(), "PrivateVal");
|
||||||
final Field[] fields = aClass.getDeclaredFields();
|
final Field[] fields = aClass.getDeclaredFields();
|
||||||
@@ -43,7 +40,6 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testPrivateVar() throws Exception {
|
public void testPrivateVar() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile();
|
loadFile();
|
||||||
final Class aClass = loadImplementationClass(generateClassesInFile(), "PrivateVar");
|
final Class aClass = loadImplementationClass(generateClassesInFile(), "PrivateVar");
|
||||||
final Object instance = aClass.newInstance();
|
final Object instance = aClass.newInstance();
|
||||||
@@ -54,7 +50,6 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testPublicVar() throws Exception {
|
public void testPublicVar() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("class PublicVar() { public var foo : Int = 0; }");
|
loadText("class PublicVar() { public var foo : Int = 0; }");
|
||||||
final Class aClass = loadImplementationClass(generateClassesInFile(), "PublicVar");
|
final Class aClass = loadImplementationClass(generateClassesInFile(), "PublicVar");
|
||||||
final Object instance = aClass.newInstance();
|
final Object instance = aClass.newInstance();
|
||||||
@@ -65,7 +60,6 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testAccessorsInInterface() {
|
public void testAccessorsInInterface() {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("class AccessorsInInterface() { public var foo : Int = 0; }");
|
loadText("class AccessorsInInterface() { public var foo : Int = 0; }");
|
||||||
final Class aClass = loadClass("AccessorsInInterface", generateClassesInFile());
|
final Class aClass = loadClass("AccessorsInInterface", generateClassesInFile());
|
||||||
assertNotNull(findMethodByName(aClass, "getFoo"));
|
assertNotNull(findMethodByName(aClass, "getFoo"));
|
||||||
@@ -73,7 +67,6 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testPrivatePropertyInNamespace() throws Exception {
|
public void testPrivatePropertyInNamespace() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("private val x = 239");
|
loadText("private val x = 239");
|
||||||
final Class nsClass = generateNamespaceClass();
|
final Class nsClass = generateNamespaceClass();
|
||||||
final Field[] fields = nsClass.getDeclaredFields();
|
final Field[] fields = nsClass.getDeclaredFields();
|
||||||
@@ -86,7 +79,6 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testFieldPropertyAccess() throws Exception {
|
public void testFieldPropertyAccess() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile("properties/fieldPropertyAccess.jet");
|
loadFile("properties/fieldPropertyAccess.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method method = generateFunction();
|
final Method method = generateFunction();
|
||||||
@@ -95,14 +87,12 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testFieldGetter() throws Exception {
|
public void testFieldGetter() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("val now: Long get() = System.currentTimeMillis(); fun foo() = now");
|
loadText("val now: Long get() = System.currentTimeMillis(); fun foo() = now");
|
||||||
final Method method = generateFunction("foo");
|
final Method method = generateFunction("foo");
|
||||||
assertIsCurrentTime((Long) method.invoke(null));
|
assertIsCurrentTime((Long) method.invoke(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testFieldSetter() throws Exception {
|
public void testFieldSetter() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile();
|
loadFile();
|
||||||
final Method method = generateFunction("append");
|
final Method method = generateFunction("append");
|
||||||
method.invoke(null, "IntelliJ ");
|
method.invoke(null, "IntelliJ ");
|
||||||
@@ -114,7 +104,6 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testFieldSetterPlusEq() throws Exception {
|
public void testFieldSetterPlusEq() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile();
|
loadFile();
|
||||||
final Method method = generateFunction("append");
|
final Method method = generateFunction("append");
|
||||||
method.invoke(null, "IntelliJ ");
|
method.invoke(null, "IntelliJ ");
|
||||||
@@ -123,7 +112,6 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testAccessorsWithoutBody() throws Exception {
|
public void testAccessorsWithoutBody() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("class AccessorsWithoutBody() { protected var foo: Int = 349\n get\n private set\n fun setter() { foo = 610; } } ");
|
loadText("class AccessorsWithoutBody() { protected var foo: Int = 349\n get\n private set\n fun setter() { foo = 610; } } ");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Class aClass = loadImplementationClass(generateClassesInFile(), "AccessorsWithoutBody");
|
final Class aClass = loadImplementationClass(generateClassesInFile(), "AccessorsWithoutBody");
|
||||||
@@ -141,7 +129,6 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testInitializersForNamespaceProperties() throws Exception {
|
public void testInitializersForNamespaceProperties() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("val x = System.currentTimeMillis()");
|
loadText("val x = System.currentTimeMillis()");
|
||||||
final Method method = generateFunction("getX");
|
final Method method = generateFunction("getX");
|
||||||
method.setAccessible(true);
|
method.setAccessible(true);
|
||||||
@@ -149,7 +136,6 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testPropertyReceiverOnStack() throws Exception {
|
public void testPropertyReceiverOnStack() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadFile();
|
loadFile();
|
||||||
final Class aClass = loadImplementationClass(generateClassesInFile(), "Evaluator");
|
final Class aClass = loadImplementationClass(generateClassesInFile(), "Evaluator");
|
||||||
final Constructor constructor = aClass.getConstructor(StringBuilder.class);
|
final Constructor constructor = aClass.getConstructor(StringBuilder.class);
|
||||||
@@ -161,7 +147,6 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testAbstractVal() throws Exception {
|
public void testAbstractVal() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("abstract class Foo { public abstract val x: String }");
|
loadText("abstract class Foo { public abstract val x: String }");
|
||||||
final ClassFileFactory codegens = generateClassesInFile();
|
final ClassFileFactory codegens = generateClassesInFile();
|
||||||
final Class aClass = loadClass("Foo", codegens);
|
final Class aClass = loadClass("Foo", codegens);
|
||||||
@@ -169,7 +154,6 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testVolatileProperty() throws Exception {
|
public void testVolatileProperty() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("abstract class Foo { public volatile var x: String = \"\"; }");
|
loadText("abstract class Foo { public volatile var x: String = \"\"; }");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final ClassFileFactory codegens = generateClassesInFile();
|
final ClassFileFactory codegens = generateClassesInFile();
|
||||||
@@ -179,18 +163,15 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt257 () throws Exception {
|
public void testKt257 () throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt257.jet");
|
blackBoxFile("regressions/kt257.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt613 () throws Exception {
|
public void testKt613 () throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt613.jet");
|
blackBoxFile("regressions/kt613.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt160() throws Exception {
|
public void testKt160() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("internal val s = java.lang.Double.toString(1.0)");
|
loadText("internal val s = java.lang.Double.toString(1.0)");
|
||||||
final Method method = generateFunction("getS");
|
final Method method = generateFunction("getS");
|
||||||
method.setAccessible(true);
|
method.setAccessible(true);
|
||||||
@@ -198,12 +179,10 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1165() throws Exception {
|
public void testKt1165() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt1165.kt");
|
blackBoxFile("regressions/kt1165.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1168() throws Exception {
|
public void testKt1168() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt1168.kt");
|
blackBoxFile("regressions/kt1168.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,17 +192,14 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1159() throws Exception {
|
public void testKt1159() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt1159.kt");
|
blackBoxFile("regressions/kt1159.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1417() throws Exception {
|
public void testKt1417() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt1417.kt");
|
blackBoxFile("regressions/kt1417.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1398() throws Exception {
|
public void testKt1398() throws Exception {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt1398.kt");
|
blackBoxFile("regressions/kt1398.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,15 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
public class SafeRefTest extends CodegenTestCase {
|
public class SafeRefTest extends CodegenTestCase {
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void test247 () throws Exception {
|
public void test247 () throws Exception {
|
||||||
blackBoxFile("regressions/kt247.jet");
|
blackBoxFile("regressions/kt247.jet");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
@@ -27,12 +25,6 @@ import java.lang.reflect.Method;
|
|||||||
*/
|
*/
|
||||||
public class StringsTest extends CodegenTestCase {
|
public class StringsTest extends CodegenTestCase {
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAnyToString () throws InvocationTargetException, IllegalAccessException {
|
public void testAnyToString () throws InvocationTargetException, IllegalAccessException {
|
||||||
loadText("fun foo(x: Any) = x.toString()");
|
loadText("fun foo(x: Any) = x.toString()");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
|
|||||||
@@ -16,16 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
public class SuperGenTest extends CodegenTestCase {
|
public class SuperGenTest extends CodegenTestCase {
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testBasicProperty () {
|
public void testBasicProperty () {
|
||||||
blackBoxFile("/super/basicproperty.jet");
|
blackBoxFile("/super/basicproperty.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
|
|||||||
@@ -16,16 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
public class TraitsTest extends CodegenTestCase {
|
public class TraitsTest extends CodegenTestCase {
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getPrefix() {
|
protected String getPrefix() {
|
||||||
return "traits";
|
return "traits";
|
||||||
|
|||||||
@@ -16,11 +16,8 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
public class TupleGenTest extends CodegenTestCase {
|
public class TupleGenTest extends CodegenTestCase {
|
||||||
public void testBasic() {
|
public void testBasic() {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("/tuples/basic.jet");
|
blackBoxFile("/tuples/basic.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import jet.TypeCastException;
|
import jet.TypeCastException;
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
@@ -26,13 +25,6 @@ import java.lang.reflect.Method;
|
|||||||
* @author alex.tkachman
|
* @author alex.tkachman
|
||||||
*/
|
*/
|
||||||
public class TypeInfoTest extends CodegenTestCase {
|
public class TypeInfoTest extends CodegenTestCase {
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getPrefix() {
|
protected String getPrefix() {
|
||||||
return "typeInfo";
|
return "typeInfo";
|
||||||
|
|||||||
@@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
import java.lang.reflect.Array;
|
import java.lang.reflect.Array;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
@@ -28,7 +26,6 @@ import java.util.Arrays;
|
|||||||
*/
|
*/
|
||||||
public class VarArgTest extends CodegenTestCase {
|
public class VarArgTest extends CodegenTestCase {
|
||||||
public void testStringArray () throws InvocationTargetException, IllegalAccessException {
|
public void testStringArray () throws InvocationTargetException, IllegalAccessException {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("fun test(vararg ts: String) = ts");
|
loadText("fun test(vararg ts: String) = ts");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
@@ -37,7 +34,6 @@ public class VarArgTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testIntArray () throws InvocationTargetException, IllegalAccessException {
|
public void testIntArray () throws InvocationTargetException, IllegalAccessException {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("fun test(vararg ts: Int) = ts");
|
loadText("fun test(vararg ts: Int) = ts");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
@@ -46,7 +42,6 @@ public class VarArgTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testIntArrayKotlinNoArgs () throws InvocationTargetException, IllegalAccessException {
|
public void testIntArrayKotlinNoArgs () throws InvocationTargetException, IllegalAccessException {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("fun test() = testf(); fun testf(vararg ts: Int) = ts");
|
loadText("fun test() = testf(); fun testf(vararg ts: Int) = ts");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction("test");
|
final Method main = generateFunction("test");
|
||||||
@@ -55,7 +50,6 @@ public class VarArgTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testIntArrayKotlin () throws InvocationTargetException, IllegalAccessException {
|
public void testIntArrayKotlin () throws InvocationTargetException, IllegalAccessException {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("fun test() = testf(239, 7); fun testf(vararg ts: Int) = ts");
|
loadText("fun test() = testf(239, 7); fun testf(vararg ts: Int) = ts");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction("test");
|
final Method main = generateFunction("test");
|
||||||
@@ -66,7 +60,6 @@ public class VarArgTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testNullableIntArrayKotlin () throws InvocationTargetException, IllegalAccessException {
|
public void testNullableIntArrayKotlin () throws InvocationTargetException, IllegalAccessException {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("fun test() = testf(239.toByte(), 7.toByte()); fun testf(vararg ts: Byte?) = ts");
|
loadText("fun test() = testf(239.toByte(), 7.toByte()); fun testf(vararg ts: Byte?) = ts");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction("test");
|
final Method main = generateFunction("test");
|
||||||
@@ -77,7 +70,6 @@ public class VarArgTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testIntArrayKotlinObj () throws InvocationTargetException, IllegalAccessException {
|
public void testIntArrayKotlinObj () throws InvocationTargetException, IllegalAccessException {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("fun test() = testf(\"239\"); fun testf(vararg ts: String) = ts");
|
loadText("fun test() = testf(\"239\"); fun testf(vararg ts: String) = ts");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction("test");
|
final Method main = generateFunction("test");
|
||||||
@@ -87,7 +79,6 @@ public class VarArgTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testArrayT () throws InvocationTargetException, IllegalAccessException {
|
public void testArrayT () throws InvocationTargetException, IllegalAccessException {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("fun test() = _array(2, 4); fun <T> _array(vararg elements : T) = elements");
|
loadText("fun test() = _array(2, 4); fun <T> _array(vararg elements : T) = elements");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction("test");
|
final Method main = generateFunction("test");
|
||||||
@@ -103,12 +94,10 @@ public class VarArgTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt797() {
|
public void testKt797() {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
blackBoxFile("regressions/kt796_797.jet");
|
blackBoxFile("regressions/kt796_797.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testArrayAsVararg () throws InvocationTargetException, IllegalAccessException {
|
public void testArrayAsVararg () throws InvocationTargetException, IllegalAccessException {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("private fun asList(vararg elems: String) = elems; fun test(ts: Array<String>) = asList(*ts); ");
|
loadText("private fun asList(vararg elems: String) = elems; fun test(ts: Array<String>) = asList(*ts); ");
|
||||||
//System.out.println(generateToText());
|
//System.out.println(generateToText());
|
||||||
final Method main = generateFunction("test");
|
final Method main = generateFunction("test");
|
||||||
@@ -117,7 +106,6 @@ public class VarArgTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testArrayAsVararg2 () throws InvocationTargetException, IllegalAccessException {
|
public void testArrayAsVararg2 () throws InvocationTargetException, IllegalAccessException {
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.JDK_HEADERS);
|
|
||||||
loadText("private fun asList(vararg elems: String) = elems; fun test(ts1: Array<String>, ts2: String) = asList(*ts1, ts2); ");
|
loadText("private fun asList(vararg elems: String) = elems; fun test(ts1: Array<String>, ts2: String) = asList(*ts1, ts2); ");
|
||||||
System.out.println(generateToText());
|
System.out.println(generateToText());
|
||||||
final Method main = generateFunction("test");
|
final Method main = generateFunction("test");
|
||||||
|
|||||||
@@ -41,14 +41,6 @@ import java.util.List;
|
|||||||
* @since 4/6/12
|
* @since 4/6/12
|
||||||
*/
|
*/
|
||||||
public class DescriptorRendererTest extends JetLiteFixture {
|
public class DescriptorRendererTest extends JetLiteFixture {
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
createEnvironmentWithMockJdk();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void testGlobalProperties() throws IOException {
|
public void testGlobalProperties() throws IOException {
|
||||||
doTest();
|
doTest();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.CompileCompilerDependenciesTest;
|
import org.jetbrains.jet.CompileCompilerDependenciesTest;
|
||||||
import org.jetbrains.jet.analyzer.AnalyzeExhaust;
|
import org.jetbrains.jet.analyzer.AnalyzeExhaust;
|
||||||
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
|
||||||
import org.jetbrains.jet.lang.cfg.pseudocode.JetControlFlowDataTraceFactory;
|
import org.jetbrains.jet.lang.cfg.pseudocode.JetControlFlowDataTraceFactory;
|
||||||
import org.jetbrains.jet.lang.descriptors.*;
|
import org.jetbrains.jet.lang.descriptors.*;
|
||||||
import org.jetbrains.jet.lang.diagnostics.Diagnostic;
|
import org.jetbrains.jet.lang.diagnostics.Diagnostic;
|
||||||
@@ -79,13 +78,9 @@ public abstract class ExpectedResolveData {
|
|||||||
private final Map<String, DeclarationDescriptor> nameToDescriptor;
|
private final Map<String, DeclarationDescriptor> nameToDescriptor;
|
||||||
private final Map<String, PsiElement> nameToPsiElement;
|
private final Map<String, PsiElement> nameToPsiElement;
|
||||||
|
|
||||||
@NotNull
|
public ExpectedResolveData(Map<String, DeclarationDescriptor> nameToDescriptor, Map<String, PsiElement> nameToPsiElement) {
|
||||||
private final JetCoreEnvironment jetCoreEnvironment;
|
|
||||||
|
|
||||||
public ExpectedResolveData(Map<String, DeclarationDescriptor> nameToDescriptor, Map<String, PsiElement> nameToPsiElement, @NotNull JetCoreEnvironment environment) {
|
|
||||||
this.nameToDescriptor = nameToDescriptor;
|
this.nameToDescriptor = nameToDescriptor;
|
||||||
this.nameToPsiElement = nameToPsiElement;
|
this.nameToPsiElement = nameToPsiElement;
|
||||||
jetCoreEnvironment = environment;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final JetFile createFileFromMarkedUpText(String fileName, String text) {
|
public final JetFile createFileFromMarkedUpText(String fileName, String text) {
|
||||||
@@ -148,7 +143,7 @@ public abstract class ExpectedResolveData {
|
|||||||
|
|
||||||
AnalyzeExhaust analyzeExhaust = AnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(project, files,
|
AnalyzeExhaust analyzeExhaust = AnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(project, files,
|
||||||
Predicates.<PsiFile>alwaysTrue(), JetControlFlowDataTraceFactory.EMPTY,
|
Predicates.<PsiFile>alwaysTrue(), JetControlFlowDataTraceFactory.EMPTY,
|
||||||
jetCoreEnvironment.getCompilerDependencies());
|
CompileCompilerDependenciesTest.compilerDependenciesForTests(CompilerSpecialMode.REGULAR, true));
|
||||||
BindingContext bindingContext = analyzeExhaust.getBindingContext();
|
BindingContext bindingContext = analyzeExhaust.getBindingContext();
|
||||||
for (Diagnostic diagnostic : bindingContext.getDiagnostics()) {
|
for (Diagnostic diagnostic : bindingContext.getDiagnostics()) {
|
||||||
if (diagnostic.getFactory() instanceof UnresolvedReferenceDiagnosticFactory) {
|
if (diagnostic.getFactory() instanceof UnresolvedReferenceDiagnosticFactory) {
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import org.jetbrains.annotations.NonNls;
|
|||||||
import org.jetbrains.jet.JetLiteFixture;
|
import org.jetbrains.jet.JetLiteFixture;
|
||||||
import org.jetbrains.jet.JetTestUtils;
|
import org.jetbrains.jet.JetTestUtils;
|
||||||
import org.jetbrains.jet.lang.psi.JetFile;
|
import org.jetbrains.jet.lang.psi.JetFile;
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -33,9 +32,6 @@ public abstract class ExtensibleResolveTestCase extends JetLiteFixture {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
|
|
||||||
createEnvironmentWithMockJdk(CompilerSpecialMode.STDLIB);
|
|
||||||
|
|
||||||
expectedResolveData = getExpectedResolveData();
|
expectedResolveData = getExpectedResolveData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import com.intellij.psi.PsiElement;
|
|||||||
import com.intellij.psi.PsiMethod;
|
import com.intellij.psi.PsiMethod;
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.jet.CompileCompilerDependenciesTest;
|
||||||
import org.jetbrains.jet.JetTestCaseBuilder;
|
import org.jetbrains.jet.JetTestCaseBuilder;
|
||||||
import org.jetbrains.jet.di.InjectorForJavaSemanticServices;
|
import org.jetbrains.jet.di.InjectorForJavaSemanticServices;
|
||||||
import org.jetbrains.jet.di.InjectorForTests;
|
import org.jetbrains.jet.di.InjectorForTests;
|
||||||
@@ -36,6 +37,8 @@ import org.jetbrains.jet.lang.resolve.FqName;
|
|||||||
import org.jetbrains.jet.lang.resolve.calls.CallResolver;
|
import org.jetbrains.jet.lang.resolve.calls.CallResolver;
|
||||||
import org.jetbrains.jet.lang.resolve.calls.OverloadResolutionResults;
|
import org.jetbrains.jet.lang.resolve.calls.OverloadResolutionResults;
|
||||||
import org.jetbrains.jet.lang.resolve.calls.ResolvedCall;
|
import org.jetbrains.jet.lang.resolve.calls.ResolvedCall;
|
||||||
|
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
||||||
|
import org.jetbrains.jet.lang.resolve.java.JavaDescriptorResolver;
|
||||||
import org.jetbrains.jet.lang.resolve.java.PsiClassFinder;
|
import org.jetbrains.jet.lang.resolve.java.PsiClassFinder;
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor;
|
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor;
|
||||||
import org.jetbrains.jet.lang.types.JetType;
|
import org.jetbrains.jet.lang.types.JetType;
|
||||||
@@ -100,7 +103,7 @@ public class JetResolveTest extends ExtensibleResolveTestCase {
|
|||||||
nameToDeclaration.put("java::java.lang.Number", java_lang_Number);
|
nameToDeclaration.put("java::java.lang.Number", java_lang_Number);
|
||||||
nameToDeclaration.put("java::java.lang.Number.intValue()", java_lang_Number.findMethodsByName("intValue", true)[0]);
|
nameToDeclaration.put("java::java.lang.Number.intValue()", java_lang_Number.findMethodsByName("intValue", true)[0]);
|
||||||
|
|
||||||
return new ExpectedResolveData(nameToDescriptor, nameToDeclaration, myEnvironment) {
|
return new ExpectedResolveData(nameToDescriptor, nameToDeclaration) {
|
||||||
@Override
|
@Override
|
||||||
protected JetFile createJetFile(String fileName, String text) {
|
protected JetFile createJetFile(String fileName, String text) {
|
||||||
return createCheckAndReturnPsiFile(fileName, text);
|
return createCheckAndReturnPsiFile(fileName, text);
|
||||||
@@ -124,7 +127,7 @@ public class JetResolveTest extends ExtensibleResolveTestCase {
|
|||||||
private PsiClass findClass(String qualifiedName) {
|
private PsiClass findClass(String qualifiedName) {
|
||||||
Project project = getProject();
|
Project project = getProject();
|
||||||
InjectorForJavaSemanticServices injector = new InjectorForJavaSemanticServices(
|
InjectorForJavaSemanticServices injector = new InjectorForJavaSemanticServices(
|
||||||
myEnvironment.getCompilerDependencies(), project);
|
CompileCompilerDependenciesTest.compilerDependenciesForTests(CompilerSpecialMode.REGULAR, true), project);
|
||||||
return injector.getPsiClassFinderForJvm().findPsiClass(new FqName(qualifiedName), PsiClassFinder.RuntimeClassesHandleMode.THROW);
|
return injector.getPsiClassFinderForJvm().findPsiClass(new FqName(qualifiedName), PsiClassFinder.RuntimeClassesHandleMode.THROW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,14 +22,6 @@ import org.jetbrains.jet.codegen.CodegenTestCase;
|
|||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
public class JetNpeTest extends CodegenTestCase {
|
public class JetNpeTest extends CodegenTestCase {
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
createEnvironmentWithMockJdk();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void testStackTrace () {
|
public void testStackTrace () {
|
||||||
try {
|
try {
|
||||||
Intrinsics.throwNpe();
|
Intrinsics.throwNpe();
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ public class JetDefaultModalityModifiersTest extends JetLiteFixture {
|
|||||||
@Override
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
super.createEnvironmentWithMockJdk();
|
|
||||||
tc.setUp();
|
tc.setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ public class JetOverloadTest extends JetLiteFixture {
|
|||||||
@Override
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdk();
|
|
||||||
InjectorForTests injector = new InjectorForTests(getProject());
|
InjectorForTests injector = new InjectorForTests(getProject());
|
||||||
library = injector.getJetStandardLibrary();
|
library = injector.getJetStandardLibrary();
|
||||||
descriptorResolver = injector.getDescriptorResolver();
|
descriptorResolver = injector.getDescriptorResolver();
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ public class JetOverridingTest extends JetLiteFixture {
|
|||||||
@Override
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdk();
|
|
||||||
InjectorForTests injector = new InjectorForTests(getProject());
|
InjectorForTests injector = new InjectorForTests(getProject());
|
||||||
library = injector.getJetStandardLibrary();
|
library = injector.getJetStandardLibrary();
|
||||||
descriptorResolver = injector.getDescriptorResolver();
|
descriptorResolver = injector.getDescriptorResolver();
|
||||||
|
|||||||
@@ -66,9 +66,6 @@ public class JetTypeCheckerTest extends JetLiteFixture {
|
|||||||
@Override
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
|
|
||||||
super.createEnvironmentWithMockJdk();
|
|
||||||
|
|
||||||
library = JetStandardLibrary.getInstance();
|
library = JetStandardLibrary.getInstance();
|
||||||
classDefinitions = new ClassDefinitions();
|
classDefinitions = new ClassDefinitions();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user