JS backend: added tests that checks constructing ArrayList with capacity.

This commit is contained in:
Zalim Bashorov
2013-08-08 19:51:49 +04:00
parent 1ddf60ef0a
commit 185ec381e3
3 changed files with 30 additions and 0 deletions
@@ -68,4 +68,12 @@ public final class ArrayListTest extends JavaClassesTest {
public void testMisc() throws Exception {
fooBoxTest();
}
public void testConstructWithCapacity() throws Exception {
fooBoxTest();
}
public void testConstructWithSideEffectParam() throws Exception {
fooBoxTest();
}
}
@@ -0,0 +1,8 @@
package foo
import java.util.ArrayList
fun box(): Boolean {
val al = ArrayList<Int>(10)
return al.size() == 0
}
@@ -0,0 +1,14 @@
package foo
import java.util.ArrayList
var baz = 0
fun withSideEffect(v: Int): Int {
baz = v
return v
}
fun box(): Boolean {
val al = ArrayList<Int>(withSideEffect(2))
return al.size() == 0 && baz == 2
}