Implement reduce and reduceRight functions
- move arrays reduce tests
This commit is contained in:
@@ -222,11 +222,6 @@ class CollectionTest {
|
||||
list.reduce { a, b -> a + b }
|
||||
}
|
||||
|
||||
expect(-4) {
|
||||
val array = array(1, 2, 3)
|
||||
array.reduce { a, b -> a - b }
|
||||
}
|
||||
|
||||
failsWith<UnsupportedOperationException> {
|
||||
arrayList<Int>().reduce { a, b -> a + b}
|
||||
}
|
||||
@@ -237,10 +232,6 @@ class CollectionTest {
|
||||
val list = arrayList("1", "2", "3", "4")
|
||||
list.reduceRight { a, b -> a + b }
|
||||
}
|
||||
expect(2) {
|
||||
val array = array(1, 2, 3)
|
||||
array.reduceRight { a, b -> a - b }
|
||||
}
|
||||
|
||||
failsWith<UnsupportedOperationException> {
|
||||
arrayList<Int>().reduceRight { a, b -> a + b}
|
||||
|
||||
Reference in New Issue
Block a user