some debug print commented out
This commit is contained in:
@@ -9,7 +9,7 @@ public class ArrayGenTest extends CodegenTestCase {
|
||||
|
||||
public void testKt326 () throws Exception {
|
||||
blackBoxFile("regressions/kt326.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
|
||||
public void testCreateMultiInt () throws Exception {
|
||||
@@ -39,7 +39,7 @@ public class ArrayGenTest extends CodegenTestCase {
|
||||
|
||||
public void testCreateMultiGenerics () throws Exception {
|
||||
loadText("class L<T>() { val a = Array<T?>(5) } fun foo() = L<Int>.a");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
Object invoke = foo.invoke(null);
|
||||
System.out.println(invoke.getClass());
|
||||
@@ -48,7 +48,7 @@ public class ArrayGenTest extends CodegenTestCase {
|
||||
|
||||
public void testIntGenerics () throws Exception {
|
||||
loadText("class L<T>(var a : T) {} fun foo() = L<Int>(5).a");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
Object invoke = foo.invoke(null);
|
||||
System.out.println(invoke.getClass());
|
||||
@@ -57,147 +57,147 @@ public class ArrayGenTest extends CodegenTestCase {
|
||||
|
||||
public void testIterator () throws Exception {
|
||||
loadText("fun box() { val x = Array<Int>(5, { it } ).iterator(); while(x.hasNext) { java.lang.System.out?.println(x.next()) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
|
||||
public void testPrimitiveIterator () throws Exception {
|
||||
loadText("fun box() { val x = ByteArray(5).iterator(); while(x.hasNext) { java.lang.System.out?.println(x.nextByte()) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
|
||||
public void testPrimitiveIteratorByte () throws Exception {
|
||||
loadText("fun box() { for(x in ByteArray(5)) { java.lang.System.out?.println(x) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
|
||||
public void testPrimitiveIteratorShort () throws Exception {
|
||||
loadText("fun box() { for(x in ShortArray(5)) { java.lang.System.out?.println(x) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
|
||||
public void testPrimitiveIteratorInt () throws Exception {
|
||||
loadText("fun box() { for(x in IntArray(5)) { java.lang.System.out?.println(x) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
|
||||
public void testPrimitiveIteratorLong () throws Exception {
|
||||
loadText("fun box() { for(x in LongArray(5)) { java.lang.System.out?.println(x) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
|
||||
public void testPrimitiveIteratorFloat () throws Exception {
|
||||
loadText("fun box() { for(x in FloatArray(5)) { java.lang.System.out?.println(x) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
|
||||
public void testPrimitiveIteratorDouble () throws Exception {
|
||||
loadText("fun box() { for(x in DoubleArray(5)) { java.lang.System.out?.println(x) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
|
||||
public void testPrimitiveIteratorChar () throws Exception {
|
||||
loadText("fun box() { for(x in CharArray(5)) { java.lang.System.out?.println(x) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
|
||||
public void testPrimitiveIteratorBoolean () throws Exception {
|
||||
loadText("fun box() { for(x in BooleanArray(5)) { java.lang.System.out?.println(x) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
|
||||
public void testLongIterator () throws Exception {
|
||||
loadText("fun box() { val x = LongArray(5).iterator(); while(x.hasNext) { java.lang.System.out?.println(x.nextLong()) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
|
||||
public void testCharIterator () throws Exception {
|
||||
loadText("fun box() { val x = CharArray(5).iterator(); while(x.hasNext) { java.lang.System.out?.println(x.next()) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
|
||||
public void testByteIterator () throws Exception {
|
||||
loadText("fun box() { val x = ByteArray(5).iterator(); while(x.hasNext) { java.lang.System.out?.println(x.next()) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
|
||||
public void testShortIterator () throws Exception {
|
||||
loadText("fun box() { val x = ShortArray(5).iterator(); while(x.hasNext) { java.lang.System.out?.println(x.next()) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
|
||||
public void testIntIterator () throws Exception {
|
||||
loadText("fun box() { val x = IntArray(5).iterator(); while(x.hasNext) { java.lang.System.out?.println(x.next()) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
|
||||
public void testLongIterator2 () throws Exception {
|
||||
loadText("fun box() { val x = LongArray(5).iterator(); while(x.hasNext) { java.lang.System.out?.println(x.next()) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
|
||||
public void testFloatIterator () throws Exception {
|
||||
loadText("fun box() { val x = FloatArray(5).iterator(); while(x.hasNext) { java.lang.System.out?.println(x.next()) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
|
||||
public void testDoubleIterator () throws Exception {
|
||||
loadText("fun box() { val x = ShortArray(5).iterator(); while(x.hasNext) { java.lang.System.out?.println(x.next()) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
|
||||
public void testBooleanIterator () throws Exception {
|
||||
loadText("fun box() { val x = BooleanArray(5).iterator(); while(x.hasNext) { java.lang.System.out?.println(x.next()) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
|
||||
public void testArrayIndices () throws Exception {
|
||||
loadText("fun box() { val x = Array<Int>(5, {it}).indices.iterator(); while(x.hasNext) { java.lang.System.out?.println(x.next()) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
|
||||
public void testCharIndices () throws Exception {
|
||||
loadText("fun box() { val x = CharArray(5).indices.iterator(); while(x.hasNext) { java.lang.System.out?.println(x.next()) } }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
foo.invoke(null);
|
||||
}
|
||||
@@ -208,7 +208,7 @@ public class ArrayGenTest extends CodegenTestCase {
|
||||
|
||||
public void testArrayPlusAssign () throws Exception {
|
||||
loadText("fun box() : Int { val s = IntArray(1); s [0] = 5; s[0] += 7; return s[0] }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
assertTrue((Integer)foo.invoke(null) == 12);
|
||||
}
|
||||
@@ -218,7 +218,7 @@ public class ArrayGenTest extends CodegenTestCase {
|
||||
"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]\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");
|
||||
assertTrue(foo.invoke(null).equals("57"));
|
||||
}
|
||||
@@ -228,7 +228,7 @@ public class ArrayGenTest extends CodegenTestCase {
|
||||
"fun box() : String? { val s = Array<String>(1,{ \"\" }); s [1, -1] = \"5\"; s[2, -2] += \"7\"; return s[-3,3] }\n" +
|
||||
"fun Array<String>.get(index1: Int, index2 : Int) = this[index1+index2]\n" +
|
||||
"fun Array<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");
|
||||
assertTrue(foo.invoke(null).equals("57"));
|
||||
}
|
||||
@@ -238,7 +238,7 @@ public class ArrayGenTest extends CodegenTestCase {
|
||||
"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]\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");
|
||||
assertTrue(foo.invoke(null).equals("5"));
|
||||
}
|
||||
@@ -248,7 +248,7 @@ public class ArrayGenTest extends CodegenTestCase {
|
||||
"fun box() : String? { val s = Array<String>(1,{ \"\" }); s [1, -1] = \"5\"; return s[-2, 2] }\n" +
|
||||
"fun Array<String>.get(index1: Int, index2 : Int) = this[index1+index2]\n" +
|
||||
"fun Array<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");
|
||||
assertTrue(foo.invoke(null).equals("5"));
|
||||
}
|
||||
@@ -257,7 +257,7 @@ public class ArrayGenTest extends CodegenTestCase {
|
||||
loadText(
|
||||
"fun box() : Int? { val s = java.util.HashMap<String,Int?>(); s[\"239\"] = 239; return s[\"239\"] }\n" +
|
||||
"fun java.util.HashMap<String,Int?>.set(index: String, elem: Int?) { this.put(index, elem) }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction("box");
|
||||
assertTrue((Integer)foo.invoke(null) == 239);
|
||||
}
|
||||
@@ -267,7 +267,7 @@ public class ArrayGenTest extends CodegenTestCase {
|
||||
"fun box() : Int { var l = IntArray(1); l[0.lng] = 4; l[0.lng] += 6; return l[0.lng];}\n" +
|
||||
"fun IntArray.set(index: Long, elem: Int) { this[index.int] = elem }\n" +
|
||||
"fun IntArray.get(index: Long) = this[index.int]");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction("box");
|
||||
assertTrue((Integer)foo.invoke(null) == 10);
|
||||
}
|
||||
@@ -278,12 +278,12 @@ public class ArrayGenTest extends CodegenTestCase {
|
||||
|
||||
public void testKt602() {
|
||||
blackBoxFile("regressions/kt602.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
|
||||
public void testKt594() throws Exception {
|
||||
loadFile("regressions/kt594.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
blackBox();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ClassGenTest extends CodegenTestCase {
|
||||
|
||||
public void testNewInstanceExplicitConstructor() throws Exception {
|
||||
loadFile("classes/newInstanceDefaultConstructor.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method method = generateFunction("test");
|
||||
final Integer returnValue = (Integer) method.invoke(null);
|
||||
assertEquals(610, returnValue.intValue());
|
||||
@@ -149,7 +149,7 @@ public class ClassGenTest extends CodegenTestCase {
|
||||
public void testEnumClass() throws Exception {
|
||||
loadText("enum class Direction { NORTH; SOUTH; EAST; WEST }");
|
||||
final Class direction = loadAllClasses(generateClassesInFile()).get("Direction");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Field north = direction.getField("NORTH");
|
||||
assertEquals(direction, north.getType());
|
||||
assertInstanceOf(north.get(null), direction);
|
||||
@@ -170,36 +170,36 @@ public class ClassGenTest extends CodegenTestCase {
|
||||
|
||||
public void testKt48 () throws Exception {
|
||||
blackBoxFile("regressions/kt48.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
|
||||
public void testKt309 () throws Exception {
|
||||
loadText("fun box() = null");
|
||||
final Method method = generateFunction("box");
|
||||
assertEquals(method.getReturnType().getName(), "java.lang.Object");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
|
||||
public void testKt343 () throws Exception {
|
||||
blackBoxFile("regressions/kt343.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
|
||||
public void testKt344 () throws Exception {
|
||||
loadFile("regressions/kt344.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
blackBox();
|
||||
}
|
||||
|
||||
public void testKt508 () throws Exception {
|
||||
loadFile("regressions/kt508.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
blackBox();
|
||||
}
|
||||
|
||||
public void testKt504 () throws Exception {
|
||||
loadFile("regressions/kt504.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
blackBox();
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ public class ClassGenTest extends CodegenTestCase {
|
||||
|
||||
public void testKt496 () throws Exception {
|
||||
blackBoxFile("regressions/kt496.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
|
||||
public void testKt500 () throws Exception {
|
||||
|
||||
@@ -6,7 +6,7 @@ package org.jetbrains.jet.codegen;
|
||||
public class ClosuresGenTest extends CodegenTestCase {
|
||||
public void testSimplestClosure() throws Exception {
|
||||
blackBoxFile("classes/simplestClosure.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
|
||||
public void testSimplestClosureAndBoxing() throws Exception {
|
||||
@@ -27,7 +27,7 @@ public class ClosuresGenTest extends CodegenTestCase {
|
||||
|
||||
public void testEnclosingLocalVariable() throws Exception {
|
||||
blackBoxFile("classes/enclosingLocalVariable.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
|
||||
public void testDoubleEnclosedLocalVariable() throws Exception {
|
||||
|
||||
@@ -17,7 +17,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
||||
public void testIf() throws Exception {
|
||||
loadFile();
|
||||
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
assertEquals(15, main.invoke(null, true));
|
||||
assertEquals(20, main.invoke(null, false));
|
||||
@@ -26,7 +26,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
||||
public void testSingleBranchIf() throws Exception {
|
||||
loadFile();
|
||||
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
assertEquals(15, main.invoke(null, true));
|
||||
assertEquals(20, main.invoke(null, false));
|
||||
@@ -47,7 +47,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
||||
private void factorialTest(final String name) throws IllegalAccessException, InvocationTargetException {
|
||||
loadFile(name);
|
||||
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
assertEquals(6, main.invoke(null, 3));
|
||||
assertEquals(120, main.invoke(null, 5));
|
||||
@@ -55,7 +55,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
||||
|
||||
public void testContinue() throws Exception {
|
||||
loadFile();
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
assertEquals(3, main.invoke(null, 4));
|
||||
assertEquals(7, main.invoke(null, 5));
|
||||
@@ -63,7 +63,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
||||
|
||||
public void testIfNoElse() throws Exception {
|
||||
loadFile();
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
assertEquals(5, main.invoke(null, 5, true));
|
||||
assertEquals(10, main.invoke(null, 5, false));
|
||||
@@ -78,7 +78,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
||||
|
||||
public void testFor() throws Exception {
|
||||
loadFile();
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
List<String> args = Arrays.asList("IntelliJ", " ", "IDEA");
|
||||
assertEquals("IntelliJ IDEA", main.invoke(null, args));
|
||||
@@ -86,7 +86,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
||||
|
||||
public void testIfBlock() throws Exception {
|
||||
loadFile();
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
List<String> args = Arrays.asList("IntelliJ", " ", "IDEA");
|
||||
assertEquals("TTT", main.invoke(null, args));
|
||||
@@ -96,7 +96,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
||||
|
||||
public void testForInArray() throws Exception {
|
||||
loadFile();
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
String[] args = new String[] { "IntelliJ", " ", "IDEA" };
|
||||
assertEquals("IntelliJ IDEA", main.invoke(null, new Object[] { args }));
|
||||
@@ -126,7 +126,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
||||
|
||||
public void testTryCatch() throws Exception {
|
||||
loadFile();
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
assertEquals("no message", main.invoke(null, "0"));
|
||||
assertEquals("For input string: \"a\"", main.invoke(null, "a"));
|
||||
@@ -134,7 +134,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
||||
|
||||
public void testTryFinally() throws Exception {
|
||||
loadFile();
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
main.invoke(null, sb, "9");
|
||||
@@ -187,8 +187,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
||||
|
||||
public void testCompareToNonnullableEq() throws Exception {
|
||||
loadText("fun foo(a: String?, b: String): Boolean = a == b || b == a");
|
||||
String text = generateToText();
|
||||
System.out.println(text);
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
assertEquals(false, main.invoke(null, null, "lala"));
|
||||
assertEquals(true, main.invoke(null, "papa", "papa"));
|
||||
@@ -197,7 +196,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
||||
public void testCompareToNonnullableNotEq() throws Exception {
|
||||
loadText("fun foo(a: String?, b: String): Boolean = a != b");
|
||||
String text = generateToText();
|
||||
System.out.println(text);
|
||||
// System.out.println(text);
|
||||
assertTrue(text.contains("IXOR"));
|
||||
final Method main = generateFunction();
|
||||
assertEquals(true, main.invoke(null, null, "lala"));
|
||||
@@ -210,7 +209,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
||||
|
||||
public void testKt416() throws Exception {
|
||||
blackBoxFile("regressions/kt416.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
|
||||
public void testKt513() throws Exception {
|
||||
|
||||
@@ -9,17 +9,17 @@ import java.lang.reflect.Method;
|
||||
public class FunctionGenTest extends CodegenTestCase {
|
||||
public void testDefaultArgs() throws Exception {
|
||||
blackBoxFile("functions/defaultargs.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
|
||||
public void testNoThisNoClosure() throws Exception {
|
||||
blackBoxFile("functions/nothisnoclosure.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
|
||||
public void testAnyToString () throws InvocationTargetException, IllegalAccessException {
|
||||
loadText("fun foo(x: Any) = x.toString()");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
assertEquals("something", foo.invoke(null, "something"));
|
||||
assertEquals("null", foo.invoke(null, new Object[]{null}));
|
||||
@@ -28,7 +28,7 @@ public class FunctionGenTest extends CodegenTestCase {
|
||||
|
||||
public void testNullableAnyToString () throws InvocationTargetException, IllegalAccessException {
|
||||
loadText("fun foo(x: Any?) = x.toString()");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
assertEquals("something", foo.invoke(null, "something"));
|
||||
assertEquals("null", foo.invoke(null, new Object[]{null}));
|
||||
@@ -63,7 +63,7 @@ public class FunctionGenTest extends CodegenTestCase {
|
||||
|
||||
public void testAnyEqualsNullable () throws InvocationTargetException, IllegalAccessException {
|
||||
loadText("fun foo(x: Any?) = x.equals(\"lala\")");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
assertTrue((Boolean) foo.invoke(null, "lala"));
|
||||
assertFalse((Boolean) foo.invoke(null, "mama"));
|
||||
@@ -71,7 +71,7 @@ public class FunctionGenTest extends CodegenTestCase {
|
||||
|
||||
public void testAnyEquals () throws InvocationTargetException, IllegalAccessException {
|
||||
loadText("fun foo(x: Any) = x.equals(\"lala\")");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
assertTrue((Boolean) foo.invoke(null, "lala"));
|
||||
assertFalse((Boolean) foo.invoke(null, "mama"));
|
||||
|
||||
@@ -17,8 +17,7 @@ import java.util.Arrays;
|
||||
public class NamespaceGenTest extends CodegenTestCase {
|
||||
public void testPSVM() throws Exception {
|
||||
loadFile("PSVM.jet");
|
||||
final String text = generateToText();
|
||||
System.out.println(text);
|
||||
// System.out.println(generateToText());
|
||||
|
||||
final Method main = generateFunction();
|
||||
Object[] args = new Object[] { new String[0] };
|
||||
@@ -27,8 +26,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testReturnOne() throws Exception {
|
||||
loadText("fun f() : Int { return 42; }");
|
||||
final String text = generateToText();
|
||||
System.out.println(text);
|
||||
// System.out.println(generateToText());
|
||||
|
||||
final Method main = generateFunction();
|
||||
final Object returnValue = main.invoke(null, new Object[0]);
|
||||
@@ -37,8 +35,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testReturnA() throws Exception {
|
||||
loadText("fun foo(a : Int) = a");
|
||||
final String text = generateToText();
|
||||
System.out.println(text);
|
||||
// System.out.println(generateToText());
|
||||
|
||||
final Method main = generateFunction();
|
||||
final Object returnValue = main.invoke(null, 50);
|
||||
@@ -47,8 +44,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testLocalProperty() throws Exception {
|
||||
loadFile("localProperty.jet");
|
||||
final String text = generateToText();
|
||||
System.out.println(text);
|
||||
// System.out.println(generateToText());
|
||||
|
||||
final Method main = generateFunction();
|
||||
final Object returnValue = main.invoke(null, 76);
|
||||
@@ -57,7 +53,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testCurrentTime() throws Exception {
|
||||
loadText("fun f() : Long { return System.currentTimeMillis(); }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
final long returnValue = (Long) main.invoke(null);
|
||||
assertIsCurrentTime(returnValue);
|
||||
@@ -65,7 +61,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testIdentityHashCode() throws Exception {
|
||||
loadText("fun f(o: Any) : Int { return System.identityHashCode(o); }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
Object o = new Object();
|
||||
final int returnValue = (Integer) main.invoke(null, o);
|
||||
@@ -82,7 +78,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
public void testHelloWorld() throws Exception {
|
||||
loadFile("helloWorld.jet");
|
||||
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
|
||||
generateFunction(); // assert that it can be verified
|
||||
}
|
||||
@@ -90,7 +86,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
public void testAssign() throws Exception {
|
||||
loadFile("assign.jet");
|
||||
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
assertEquals(2, main.invoke(null));
|
||||
}
|
||||
@@ -116,7 +112,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testBoxVariable() throws Exception {
|
||||
loadText("fun foo(): Int? { var x = 239; return x; }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
assertEquals(239, main.invoke(null));
|
||||
}
|
||||
@@ -173,14 +169,14 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testBottles2() throws Exception {
|
||||
loadFile("bottles2.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
main.invoke(null); // ensure no exception
|
||||
}
|
||||
|
||||
public void testJavaConstructor() throws Exception {
|
||||
loadText("fun foo(): StringBuilder = StringBuilder()");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
final Object result = main.invoke(null);
|
||||
assertTrue(result instanceof StringBuilder);
|
||||
@@ -195,7 +191,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testJavaEquals() throws Exception {
|
||||
loadText("fun foo(s1: String, s2: String) = s1 == s2");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
assertEquals(Boolean.TRUE, main.invoke(null, new String("jet"), new String("jet")));
|
||||
assertEquals(Boolean.FALSE, main.invoke(null, new String("jet"), new String("ceylon")));
|
||||
@@ -211,7 +207,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
public void testJavaEqualsNull() throws Exception {
|
||||
loadText("fun foo(s1: String?, s2: String?) = s1 == s2");
|
||||
final Method main = generateFunction();
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
assertEquals(Boolean.TRUE, main.invoke(null, null, null));
|
||||
assertEquals(Boolean.FALSE, main.invoke(null, "jet", null));
|
||||
assertEquals(Boolean.FALSE, main.invoke(null, null, "jet"));
|
||||
@@ -220,7 +216,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
public void testEqualsNullLiteral() throws Exception {
|
||||
loadText("fun foo(s: String?) = s == null");
|
||||
final Method main = generateFunction();
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
assertEquals(Boolean.TRUE, main.invoke(null, new Object[] { null }));
|
||||
assertEquals(Boolean.FALSE, main.invoke(null, "jet"));
|
||||
}
|
||||
@@ -245,7 +241,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testFunctionCall() throws Exception {
|
||||
loadFile("functionCall.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction("f");
|
||||
assertEquals("foo", main.invoke(null));
|
||||
}
|
||||
@@ -267,14 +263,14 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testStringPlusEq() throws Exception {
|
||||
loadText("fun foo(s: String) : String { var result = s; result += s; return result; } ");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
assertEquals("JarJar", main.invoke(null, "Jar"));
|
||||
}
|
||||
|
||||
public void testStringCompare() throws Exception {
|
||||
loadText("fun foo(s1: String, s2: String) = s1 < s2");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
assertEquals(Boolean.TRUE, main.invoke(null, "Ceylon", "Java"));
|
||||
assertEquals(Boolean.FALSE, main.invoke(null, "Jet", "Java"));
|
||||
@@ -302,7 +298,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testFieldRead() throws Exception {
|
||||
loadText("import java.awt.*; fun foo(c: GridBagConstraints) = c.gridx");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
GridBagConstraints c = new GridBagConstraints();
|
||||
c.gridx = 239;
|
||||
@@ -319,7 +315,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testFieldIncrement() throws Exception {
|
||||
loadText("import java.awt.*; fun foo(c: GridBagConstraints) { c.gridx++; return; }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
GridBagConstraints c = new GridBagConstraints();
|
||||
c.gridx = 609;
|
||||
@@ -329,7 +325,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testFieldAugAssign() throws Exception {
|
||||
loadText("import java.awt.*; fun foo(c: GridBagConstraints) { c.gridx *= 2; return; }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
GridBagConstraints c = new GridBagConstraints();
|
||||
c.gridx = 305;
|
||||
@@ -358,7 +354,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testArrayAugAssign() throws Exception {
|
||||
loadText("fun foo(c: Array<Int>) { c[0] *= 2 }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
Integer[] data = new Integer[] { 5 };
|
||||
main.invoke(null, new Object[] { data });
|
||||
@@ -367,7 +363,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testArrayAugAssignLong() throws Exception {
|
||||
loadText("fun foo(c: LongArray) { c[0] *= 2.lng }");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
long[] data = new long[] { 5 };
|
||||
main.invoke(null, new Object[] { data });
|
||||
@@ -376,7 +372,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testArrayNew() throws Exception {
|
||||
loadText("fun foo() = Array<Int>(4, { it })");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
Integer[] result = (Integer[]) main.invoke(null);
|
||||
assertEquals(4, result.length);
|
||||
@@ -388,14 +384,14 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testArrayNewNullable() throws Exception {
|
||||
loadText("fun foo() = Array<Int?>(4)");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
Integer[] result = (Integer[]) main.invoke(null);
|
||||
assertEquals(4, result.length);
|
||||
}
|
||||
public void testFloatArrayNew() throws Exception {
|
||||
loadText("fun foo() = FloatArray(4)");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
float[] result = (float[]) main.invoke(null);
|
||||
assertEquals(4, result.length);
|
||||
@@ -403,7 +399,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testFloatArrayArrayNew() throws Exception {
|
||||
loadText("fun foo() = Array<FloatArray>(4, { FloatArray(5-it) })");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
float[][] result = (float[][]) main.invoke(null);
|
||||
assertEquals(4, result.length);
|
||||
@@ -412,7 +408,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testArraySize() throws Exception {
|
||||
loadText("fun foo(a: Array<Int>) = a.size");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
Object[] args = new Object[] { new Integer[4] };
|
||||
int result = (Integer) main.invoke(null, args);
|
||||
@@ -422,7 +418,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testIntArraySize() throws Exception {
|
||||
loadText("fun foo(a: IntArray) = a.size");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
Object[] args = new Object[] { new int[4] };
|
||||
int result = (Integer) main.invoke(null, args);
|
||||
@@ -490,7 +486,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testTupleLiteral() throws Exception {
|
||||
loadText("fun foo() = (1, \"foo\")");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
Tuple2 tuple2 = (Tuple2) main.invoke(null);
|
||||
assertEquals(1, tuple2._1);
|
||||
@@ -499,7 +495,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
|
||||
public void testParametrizedTupleLiteral() throws Exception {
|
||||
loadText("fun <E,D> E.foo(extra: java.util.List<D>) = (1, \"foo\", this, extra)");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
Tuple4 tuple4 = (Tuple4) main.invoke(null, "aaa", TypeInfo.STRING_TYPE_INFO, TypeInfo.INT_TYPE_INFO, Arrays.asList(10));
|
||||
assertEquals(1, tuple4._1);
|
||||
@@ -515,7 +511,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
||||
assertNull(main.invoke(null, "IntelliJ"));
|
||||
}
|
||||
catch (Throwable t) {
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
t.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ public class ObjectGenTest extends CodegenTestCase {
|
||||
|
||||
public void testObjectLiteral() throws Exception {
|
||||
blackBoxFile("objects/objectLiteral.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
|
||||
public void testMethodOnObject() throws Exception {
|
||||
|
||||
@@ -37,7 +37,7 @@ public class PatternMatchingTest extends CodegenTestCase {
|
||||
|
||||
public void testInrange() throws Exception {
|
||||
loadFile();
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
assertEquals("array list", foo.invoke(null, 239));
|
||||
assertEquals("digit", foo.invoke(null, 0));
|
||||
@@ -49,13 +49,13 @@ public class PatternMatchingTest extends CodegenTestCase {
|
||||
|
||||
public void testIs() throws Exception {
|
||||
loadFile();
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
blackBox();
|
||||
}
|
||||
|
||||
public void testRange() throws Exception {
|
||||
loadFile();
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
assertEquals("array list", foo.invoke(null, 239));
|
||||
assertEquals("digit", foo.invoke(null, 0));
|
||||
@@ -67,7 +67,7 @@ public class PatternMatchingTest extends CodegenTestCase {
|
||||
|
||||
public void testRangeChar() throws Exception {
|
||||
loadFile();
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
assertEquals("digit", foo.invoke(null, '0'));
|
||||
assertEquals("something", foo.invoke(null, 'A'));
|
||||
|
||||
@@ -10,7 +10,7 @@ public class PrimitiveTypesTest extends CodegenTestCase {
|
||||
public void testPlus() throws Exception {
|
||||
loadText("fun f(a: Int, b: Int): Int { return a + b }");
|
||||
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
|
||||
final Method main = generateFunction();
|
||||
final int returnValue = (Integer) main.invoke(null, 37, 5);
|
||||
@@ -20,7 +20,7 @@ public class PrimitiveTypesTest extends CodegenTestCase {
|
||||
public void testGt() throws Exception {
|
||||
loadText("fun foo(f: Int): Boolean { if (f > 0) return true; return false; }");
|
||||
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
assertEquals(true, main.invoke(null, 1));
|
||||
assertEquals(false, main.invoke(null, 0));
|
||||
@@ -57,7 +57,7 @@ public class PrimitiveTypesTest extends CodegenTestCase {
|
||||
|
||||
public void testLong() throws Exception {
|
||||
loadText("fun foo(a: Long, b: Long): Long = a + b");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
long arg = (long) Integer.MAX_VALUE;
|
||||
long expected = 2 * (long) Integer.MAX_VALUE;
|
||||
@@ -66,7 +66,7 @@ public class PrimitiveTypesTest extends CodegenTestCase {
|
||||
|
||||
public void testLongCmp() throws Exception {
|
||||
loadText("fun foo(a: Long, b: Long): Long = if (a == b) 0xffffffff else 0xfffffffe");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
assertEquals(0xffffffffL, main.invoke(null, 1, 1));
|
||||
assertEquals(0xfffffffeL, main.invoke(null, 1, 0));
|
||||
@@ -132,7 +132,7 @@ public class PrimitiveTypesTest extends CodegenTestCase {
|
||||
|
||||
public void testDoubleToInt() throws Exception {
|
||||
loadText("fun foo(a: Double): Int = a.int");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
assertEquals(1, main.invoke(null, 1.0));
|
||||
}
|
||||
@@ -216,7 +216,7 @@ public class PrimitiveTypesTest extends CodegenTestCase {
|
||||
|
||||
public void testBitInv() throws Exception {
|
||||
loadText("fun foo(a: Int): Int = a.inv()");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
assertEquals(0xffff0000, main.invoke(null, 0x0000ffff));
|
||||
}
|
||||
@@ -249,14 +249,14 @@ public class PrimitiveTypesTest extends CodegenTestCase {
|
||||
|
||||
public void testDecrementAsStatement() throws Exception {
|
||||
loadFile("bottles.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
main.invoke(null); // ensure no exception
|
||||
}
|
||||
|
||||
private void binOpTest(final String text, final Object arg1, final Object arg2, final Object expected) throws Exception {
|
||||
loadText(text);
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
assertEquals(expected, main.invoke(null, arg1, arg2));
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public class PropertyGenTest extends CodegenTestCase {
|
||||
|
||||
public void testFieldPropertyAccess() throws Exception {
|
||||
loadFile("properties/fieldPropertyAccess.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method method = generateFunction();
|
||||
assertEquals(1, method.invoke(null));
|
||||
assertEquals(2, method.invoke(null));
|
||||
|
||||
@@ -71,7 +71,7 @@ public class StdlibTest extends CodegenTestCase {
|
||||
|
||||
public void testInputStreamIterator () {
|
||||
blackBoxFile("inputStreamIterator.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
|
||||
public void testKt533 () {
|
||||
|
||||
@@ -3,21 +3,21 @@ package org.jetbrains.jet.codegen;
|
||||
public class SuperGenTest extends CodegenTestCase {
|
||||
public void testBasicProperty () {
|
||||
blackBoxFile("/super/basicproperty.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
|
||||
public void testTraitProperty () {
|
||||
blackBoxFile("/super/traitproperty.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
|
||||
public void testBasicMethod () {
|
||||
blackBoxFile("/super/basicmethod.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
|
||||
public void testEnclosedMethod () {
|
||||
blackBoxFile("/super/enclosed.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,12 +8,12 @@ public class TraitsTest extends CodegenTestCase {
|
||||
|
||||
public void testSimple () throws Exception {
|
||||
blackBoxFile("traits/simple.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
|
||||
public void testWithRequired () throws Exception {
|
||||
blackBoxFile("traits/withRequired.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
|
||||
public void testMultiple () throws Exception {
|
||||
|
||||
@@ -65,7 +65,7 @@ public class TypeInfoTest extends CodegenTestCase {
|
||||
if (true) return;
|
||||
|
||||
loadFile();
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
assertFalse((Boolean) foo.invoke(null));
|
||||
}
|
||||
@@ -116,7 +116,7 @@ public class TypeInfoTest extends CodegenTestCase {
|
||||
|
||||
public void testClassObjectInTypeInfo() throws Exception {
|
||||
loadFile();
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
Method foo = generateFunction();
|
||||
JetObject jetObject = (JetObject) foo.invoke(null);
|
||||
TypeInfo<?> typeInfo = jetObject.getTypeInfo();
|
||||
@@ -135,12 +135,12 @@ public class TypeInfoTest extends CodegenTestCase {
|
||||
|
||||
public void testKt259() throws Exception {
|
||||
blackBoxFile("regressions/kt259.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
|
||||
public void testInner() throws Exception {
|
||||
blackBoxFile("typeInfo/inner.jet");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.lang.reflect.Method;
|
||||
public class VarArgTest extends CodegenTestCase {
|
||||
public void testStringArray () throws InvocationTargetException, IllegalAccessException {
|
||||
loadText("fun test(vararg ts: String) = ts");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
String[] args = {"mama", "papa"};
|
||||
assertTrue(args == main.invoke(null, new Object[]{ args } ));
|
||||
@@ -17,7 +17,7 @@ public class VarArgTest extends CodegenTestCase {
|
||||
|
||||
public void testIntArray () throws InvocationTargetException, IllegalAccessException {
|
||||
loadText("fun test(vararg ts: Int) = ts");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
int[] args = {3, 4};
|
||||
assertTrue(args == main.invoke(null, new Object[]{ args }));
|
||||
@@ -25,7 +25,7 @@ public class VarArgTest extends CodegenTestCase {
|
||||
|
||||
public void testIntArrayKotlinNoArgs () throws InvocationTargetException, IllegalAccessException {
|
||||
loadText("fun test() = testf(); fun testf(vararg ts: Int) = ts");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
Object res = main.invoke(null);
|
||||
assertTrue(((int[])res).length == 0);
|
||||
@@ -33,7 +33,7 @@ public class VarArgTest extends CodegenTestCase {
|
||||
|
||||
public void testIntArrayKotlin () throws InvocationTargetException, IllegalAccessException {
|
||||
loadText("fun test() = testf(239, 7); fun testf(vararg ts: Int) = ts");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
Object res = main.invoke(null);
|
||||
assertTrue(((int[])res).length == 2);
|
||||
@@ -43,7 +43,7 @@ public class VarArgTest extends CodegenTestCase {
|
||||
|
||||
public void testNullableIntArrayKotlin () throws InvocationTargetException, IllegalAccessException {
|
||||
loadText("fun test() = testf(239.byt, 7.byt); fun testf(vararg ts: Byte?) = ts");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
Object res = main.invoke(null);
|
||||
assertTrue(((Byte[])res).length == 2);
|
||||
@@ -53,7 +53,7 @@ public class VarArgTest extends CodegenTestCase {
|
||||
|
||||
public void testIntArrayKotlinObj () throws InvocationTargetException, IllegalAccessException {
|
||||
loadText("fun test() = testf(\"239\"); fun testf(vararg ts: String) = ts");
|
||||
System.out.println(generateToText());
|
||||
// System.out.println(generateToText());
|
||||
final Method main = generateFunction();
|
||||
Object res = main.invoke(null);
|
||||
assertTrue(((String[])res).length == 1);
|
||||
@@ -62,7 +62,7 @@ public class VarArgTest extends CodegenTestCase {
|
||||
|
||||
public void testArrayT () throws InvocationTargetException, IllegalAccessException {
|
||||
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();
|
||||
Object res = main.invoke(null);
|
||||
assertTrue(((Integer[])res).length == 2);
|
||||
|
||||
Reference in New Issue
Block a user