Reformat stdlib tests and samples

#KT-5558
This commit is contained in:
Ilya Gorbunov
2018-04-23 16:18:24 +03:00
parent add09e0f2e
commit ecf0d7ec0d
39 changed files with 389 additions and 284 deletions
@@ -9,15 +9,15 @@ import kotlin.test.*
class MutableCollectionTest {
fun <T, C: MutableCollection<T>> testOperation(before: List<T>, after: List<T>, expectedModified: Boolean, toMutableCollection: (List<T>) -> C)
= fun(operation: (C.() -> Boolean)) {
val list = toMutableCollection(before)
assertEquals(expectedModified, list.operation())
assertEquals(toMutableCollection(after), list)
}
fun <T, C : MutableCollection<T>> testOperation(before: List<T>, after: List<T>, expectedModified: Boolean, toMutableCollection: (List<T>) -> C) =
fun(operation: (C.() -> Boolean)) {
val list = toMutableCollection(before)
assertEquals(expectedModified, list.operation())
assertEquals(toMutableCollection(after), list)
}
fun <T> testOperation(before: List<T>, after: List<T>, expectedModified: Boolean)
= testOperation(before, after, expectedModified, { it.toMutableList() })
fun <T> testOperation(before: List<T>, after: List<T>, expectedModified: Boolean) =
testOperation(before, after, expectedModified, { it.toMutableList() })
@Test fun addAll() {