Existing tests for 'val reassignment' of function parameters fixed
This commit is contained in:
@@ -169,25 +169,25 @@ public class PrimitiveTypesTest extends CodegenTestCase {
|
||||
}
|
||||
|
||||
public void testPreDecrement() throws Exception {
|
||||
loadText("fun foo(a: Int): Int { return --a;}");
|
||||
loadText("fun foo(var a: Int): Int { return --a;}");
|
||||
final Method main = generateFunction();
|
||||
assertEquals(9, main.invoke(null, 10));
|
||||
}
|
||||
|
||||
public void testPreIncrementLong() throws Exception {
|
||||
loadText("fun foo(a: Long): Long = ++a");
|
||||
loadText("fun foo(var a: Long): Long = ++a");
|
||||
final Method main = generateFunction();
|
||||
assertEquals(11L, main.invoke(null, 10L));
|
||||
}
|
||||
|
||||
public void testPreIncrementFloat() throws Exception {
|
||||
loadText("fun foo(a: Float): Float = ++a");
|
||||
loadText("fun foo(var a: Float): Float = ++a");
|
||||
final Method main = generateFunction();
|
||||
assertEquals(2.0f, main.invoke(null, 1.0f));
|
||||
}
|
||||
|
||||
public void testPreIncrementDouble() throws Exception {
|
||||
loadText("fun foo(a: Double): Double = ++a");
|
||||
loadText("fun foo(var a: Double): Double = ++a");
|
||||
final Method main = generateFunction();
|
||||
assertEquals(2.0, main.invoke(null, 1.0));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user