Rename Stream<T> to Sequence<T> and provide migration path via deprecated types and functions.

This commit is contained in:
Ilya Ryzhenkov
2015-03-10 18:10:57 +03:00
parent 9684d217b3
commit e448f40756
47 changed files with 1906 additions and 556 deletions
@@ -0,0 +1,26 @@
package test.collections
import org.junit.Test as test
import kotlin.test.assertEquals
class SequenceJVMTest {
test fun filterIsInstance() {
val src: Sequence<Any> = listOf(1, 2, 3.toDouble(), "abc", "cde").sequence()
val intValues: Sequence<Int> = src.filterIsInstance<Int>()
assertEquals(listOf(1, 2), intValues.toArrayList())
val doubleValues: Sequence<Double> = src.filterIsInstance<Double>()
assertEquals(listOf(3.0), doubleValues.toArrayList())
val stringValues: Sequence<String> = src.filterIsInstance<String>()
assertEquals(listOf("abc", "cde"), stringValues.toArrayList())
val anyValues: Sequence<Any> = src.filterIsInstance<Any>()
assertEquals(src.toList(), anyValues.toArrayList())
val charValues: Sequence<Char> = src.filterIsInstance<Char>()
assertEquals(0, charValues.toArrayList().size())
}
}