Remove obsolete codegen test data
This commit is contained in:
@@ -1,5 +0,0 @@
|
|||||||
package foo
|
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
fun f(): Int {
|
|
||||||
var x: Int = 1
|
|
||||||
x = x + 1
|
|
||||||
return x
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fun main() {
|
|
||||||
var bottles = 99;
|
|
||||||
while(bottles > 0) {
|
|
||||||
System.out?.println("bottles of beer on the wall");
|
|
||||||
bottles--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fun main() {
|
|
||||||
var bottles = 99;
|
|
||||||
while(bottles > 0) {
|
|
||||||
System.out?.println("bottles of beer on the wall");
|
|
||||||
bottles -= 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
fun box(): String {
|
||||||
|
var bottles = 99
|
||||||
|
while (bottles > 0) {
|
||||||
|
// System.out.println("bottles of beer on the wall");
|
||||||
|
bottles -= 1
|
||||||
|
bottles--
|
||||||
|
}
|
||||||
|
return if (bottles == -1) "OK" else "Fail $bottles"
|
||||||
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
fun f() : String? {
|
|
||||||
val x = StringBuilder();
|
|
||||||
g(x);
|
|
||||||
return x.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
fun g(sb: StringBuilder): Unit {
|
|
||||||
sb.append("foo");
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
fun f() { System.out?.println("Hello World"); }
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
fun f(a:Int) : Int {
|
|
||||||
val x = 42
|
|
||||||
val y = 50
|
|
||||||
|
|
||||||
return y
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
class SimpleClass {
|
|
||||||
this() {}
|
|
||||||
|
|
||||||
fun foo() = 610
|
|
||||||
}
|
|
||||||
|
|
||||||
fun test() {
|
|
||||||
val c = SimpleClass()
|
|
||||||
return c.foo()
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
fun f() : Any? { return System.out; }
|
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
|
import com.intellij.util.ArrayUtil;
|
||||||
import org.jetbrains.jet.ConfigurationKind;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
@@ -36,9 +37,9 @@ public class PackageGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testPSVM() throws Exception {
|
public void testPSVM() throws Exception {
|
||||||
loadFile("PSVM.kt");
|
loadText("fun main(args: Array<String>) { }");
|
||||||
Method main = generateFunction();
|
Method main = generateFunction();
|
||||||
Object[] args = new Object[] { new String[0] };
|
Object[] args = new Object[] {ArrayUtil.EMPTY_STRING_ARRAY};
|
||||||
main.invoke(null, args);
|
main.invoke(null, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,13 +57,6 @@ public class PackageGenTest extends CodegenTestCase {
|
|||||||
assertEquals(new Integer(50), returnValue);
|
assertEquals(new Integer(50), returnValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testLocalProperty() throws Exception {
|
|
||||||
loadFile("localProperty.kt");
|
|
||||||
Method main = generateFunction();
|
|
||||||
Object returnValue = main.invoke(null, 76);
|
|
||||||
assertEquals(new Integer(50), returnValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testCurrentTime() throws Exception {
|
public void testCurrentTime() throws Exception {
|
||||||
loadText("fun f() : Long { return System.currentTimeMillis(); }");
|
loadText("fun f() : Long { return System.currentTimeMillis(); }");
|
||||||
Method main = generateFunction();
|
Method main = generateFunction();
|
||||||
@@ -79,24 +73,12 @@ public class PackageGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testSystemOut() throws Exception {
|
public void testSystemOut() throws Exception {
|
||||||
loadFile("systemOut.kt");
|
loadText("fun f() : Any? { return System.out; }");
|
||||||
Method main = generateFunction();
|
Method main = generateFunction();
|
||||||
Object returnValue = main.invoke(null);
|
Object returnValue = main.invoke(null);
|
||||||
assertEquals(returnValue, System.out);
|
assertEquals(returnValue, System.out);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testHelloWorld() throws Exception {
|
|
||||||
loadFile("helloWorld.kt");
|
|
||||||
generateFunction(); // assert that it can be verified
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAssign() throws Exception {
|
|
||||||
loadFile("assign.kt");
|
|
||||||
|
|
||||||
Method main = generateFunction();
|
|
||||||
assertEquals(2, main.invoke(null));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testBoxedInt() throws Exception {
|
public void testBoxedInt() throws Exception {
|
||||||
loadText("fun foo(a: Int?) = if (a != null) a else 239");
|
loadText("fun foo(a: Int?) = if (a != null) a else 239");
|
||||||
Method main = generateFunction();
|
Method main = generateFunction();
|
||||||
@@ -172,12 +154,6 @@ public class PackageGenTest extends CodegenTestCase {
|
|||||||
assertTrue(hadException);
|
assertTrue(hadException);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testBottles2() throws Exception {
|
|
||||||
loadFile("bottles2.kt");
|
|
||||||
Method main = generateFunction();
|
|
||||||
main.invoke(null); // ensure no exception
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testJavaConstructor() throws Exception {
|
public void testJavaConstructor() throws Exception {
|
||||||
loadText("fun foo(): StringBuilder = StringBuilder()");
|
loadText("fun foo(): StringBuilder = StringBuilder()");
|
||||||
Method main = generateFunction();
|
Method main = generateFunction();
|
||||||
@@ -239,12 +215,6 @@ public class PackageGenTest extends CodegenTestCase {
|
|||||||
assertEquals(Boolean.TRUE, main.invoke(null, s1, s2));
|
assertEquals(Boolean.TRUE, main.invoke(null, s1, s2));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testFunctionCall() throws Exception {
|
|
||||||
loadFile("functionCall.kt");
|
|
||||||
Method main = generateFunction("f");
|
|
||||||
assertEquals("foo", main.invoke(null));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testStringPlus() throws Exception {
|
public void testStringPlus() throws Exception {
|
||||||
loadText("fun foo(s1: String, s2: String) = s1 + s2");
|
loadText("fun foo(s1: String, s2: String) = s1 + s2");
|
||||||
Method main = generateFunction();
|
Method main = generateFunction();
|
||||||
|
|||||||
@@ -261,12 +261,6 @@ public class PrimitiveTypesTest extends CodegenTestCase {
|
|||||||
assertEquals(6L, main.invoke(null, 2L));
|
assertEquals(6L, main.invoke(null, 2L));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testDecrementAsStatement() throws Exception {
|
|
||||||
loadFile("bottles.kt");
|
|
||||||
Method main = generateFunction();
|
|
||||||
main.invoke(null); // ensure no exception
|
|
||||||
}
|
|
||||||
|
|
||||||
private void binOpTest(String text, Object arg1, Object arg2, Object expected) throws Exception {
|
private void binOpTest(String text, Object arg1, Object arg2, Object expected) throws Exception {
|
||||||
loadText(text);
|
loadText(text);
|
||||||
Method main = generateFunction();
|
Method main = generateFunction();
|
||||||
|
|||||||
@@ -1770,6 +1770,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/controlStructures"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/controlStructures"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("bottles.kt")
|
||||||
|
public void testBottles() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/bottles.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("compareBoxedIntegerToZero.kt")
|
@TestMetadata("compareBoxedIntegerToZero.kt")
|
||||||
public void testCompareBoxedIntegerToZero() throws Exception {
|
public void testCompareBoxedIntegerToZero() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/compareBoxedIntegerToZero.kt");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/compareBoxedIntegerToZero.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user