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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user