Clean TODOs, add custom Iterable implementation test.

This commit is contained in:
Ilya Ryzhenkov
2014-03-05 20:12:58 +04:00
committed by Andrey Breslav
parent ceb2aa57f9
commit 266f6ad81a
3 changed files with 20 additions and 34 deletions
@@ -4,6 +4,17 @@ import org.junit.Test
import kotlin.test.*
import java.util.*
fun <T> iterableOf(vararg items : T) : Iterable<T> = IterableWrapper(items.toList())
class IterableWrapper<T>(collection: Iterable<T>) : Iterable<T> {
private val collection = collection
override fun iterator(): Iterator<T> {
return collection.iterator()
}
}
class IterableTest : IterableTests<Iterable<String>>(iterableOf("foo", "bar"), iterableOf<String>())
class SetTest : IterableTests<Set<String>>(hashSetOf("foo", "bar"), hashSetOf<String>())
class ListTest : OrderedIterableTests<List<String>>(listOf("foo", "bar"), listOf<String>())
class ArrayListTest : OrderedIterableTests<ArrayList<String>>(arrayListOf("foo", "bar"), arrayListOf<String>())