Existing tests for 'val reassignment' of function parameters fixed

This commit is contained in:
svtk
2011-10-28 13:41:07 +04:00
parent 7db6752e20
commit c7bb6a08d4
8 changed files with 19 additions and 12 deletions
@@ -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));
}