Tests fixed
JET-85 Generate code for Java's fully qualified names -- is still open
This commit is contained in:
@@ -70,7 +70,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
||||
}
|
||||
|
||||
public void testCondJumpOnStack() throws Exception {
|
||||
loadText("fun foo(a: String): Int = if (java.lang.Boolean.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();
|
||||
assertEquals(5, main.invoke(null, "true"));
|
||||
assertEquals(10, main.invoke(null, "false"));
|
||||
|
||||
@@ -123,7 +123,7 @@ public class PrimitiveTypesTest extends CodegenTestCase {
|
||||
}
|
||||
|
||||
public void testDoubleToJava() throws Exception {
|
||||
loadText("fun foo(d: Double): String? = java.lang.Double.toString(d)");
|
||||
loadText("import java.lang.Double as jlDouble; fun foo(d: Double): String? = jlDouble.toString(d)");
|
||||
final Method main = generateFunction();
|
||||
assertEquals("1.0", main.invoke(null, 1.0));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user