added extension methods MutableCollection#addAll(Iterable) and MutableCollection#addAll(Iterator) (#KT-4202 fixed)

This commit is contained in:
Christian Laakmann
2014-01-24 18:12:45 +04:00
committed by nik
parent 624ac55415
commit 9b3d357371
2 changed files with 44 additions and 0 deletions
@@ -0,0 +1,29 @@
package test.collections
import kotlin.test.*
import java.util.*
import org.junit.Test as test
class MutableCollectionTest {
test fun fromIterable() {
val data: Iterable<String> = arrayListOf("foo", "bar")
val collection = ArrayList<String>()
collection.addAll(data)
assertEquals(data, collection)
}
test fun fromIterator() {
val list = arrayListOf("foo", "bar")
val collection = ArrayList<String>()
collection.addAll(list.iterator())
assertEquals(list, collection)
}
}