Deprecate merge and introduce instead zip with transform.

Add zip with transform for Strings.
This commit is contained in:
Ilya Gorbunov
2015-10-07 04:42:59 +03:00
parent 12d9beb3a4
commit db93532e7c
8 changed files with 536 additions and 326 deletions
@@ -134,9 +134,9 @@ class CollectionTest {
}
@test
fun merge() {
fun zipTransform() {
expect(listOf("ab", "bc", "cd")) {
listOf("a", "b", "c").merge(listOf("b", "c", "d")) { a, b -> a + b }
listOf("a", "b", "c").zip(listOf("b", "c", "d")) { a, b -> a + b }
}
}
@@ -120,9 +120,9 @@ public class SequenceTest {
assertEquals("", sequenceOf(1).dropWhile { it < 200 }.joinToString(limit = 10))
}
@test fun merge() {
@test fun zip() {
expect(listOf("ab", "bc", "cd")) {
sequenceOf("a", "b", "c").merge(sequenceOf("b", "c", "d")) { a, b -> a + b }.toList()
sequenceOf("a", "b", "c").zip(sequenceOf("b", "c", "d")) { a, b -> a + b }.toList()
}
}