added a native array() function for the JS generation; also refactored the code generated collection APIs so that most of them can be used with JavaScript and included more array based APIs into the JS generation
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package testPackage
|
||||
|
||||
import org.junit.Test as test
|
||||
import kotlin.test.*
|
||||
|
||||
class JsArrayTest {
|
||||
|
||||
test fun arrays() {
|
||||
val a1 = array<String>()
|
||||
val a2 = array("foo")
|
||||
val a3 = array("foo", "bar")
|
||||
|
||||
assertEquals(0, a1.size)
|
||||
assertEquals(1, a2.size)
|
||||
assertEquals(2, a3.size)
|
||||
|
||||
assertEquals("[]", a1.toList().toString())
|
||||
assertEquals("[foo]", a2.toList().toString())
|
||||
assertEquals("[foo, bar]", a3.toList().toString())
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user