JS: move more test to box tests

This commit is contained in:
Alexey Andreev
2016-08-29 12:37:13 +03:00
parent efb82a044f
commit cdf2212c73
70 changed files with 484 additions and 749 deletions
@@ -0,0 +1,27 @@
package foo
import java.util.*
class A<T>(val list: MutableList<T>) {
fun addAll(c: Collection<T>) {
list.addAll(c)
}
}
operator fun <T> A<T>.plusAssign(other: Collection<T>) {
addAll(other)
}
fun box(): String {
var v1 = arrayListOf("foo")
val v2 = listOf("bar")
val a = A(v1)
a += v2
if (v1.size != 2) return "fail1: ${v1.size}"
if (v1[0] != "foo") return "fail2: ${v1[0]}"
if (v1[1] != "bar") return "fail3: ${v1[1]}"
return "OK"
}