generate new array creation

This commit is contained in:
Dmitry Jemerov
2011-05-20 13:46:28 +02:00
parent 0afddb4d9e
commit c943525e08
3 changed files with 67 additions and 30 deletions
@@ -360,6 +360,13 @@ public class NamespaceGenTest extends CodegenTestCase {
assertEquals(10, data[0]);
}
public void testArrayNew() throws Exception {
loadText("fun foo() = new Array<Int>(4)");
final Method main = generateFunction();
int[] result = (int[]) main.invoke(null);
assertEquals(4, result.length);
}
public void testIntRange() throws Exception {
loadText("fun foo() = 1..10");
final Method main = generateFunction();