Merge branch 'master' of github.com:JetBrains/kotlin
This commit is contained in:
@@ -22,8 +22,8 @@
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<sourceDirectory>${project.basedir}/src</sourceDirectory>
|
||||
<testSourceDirectory>${project.basedir}/test</testSourceDirectory>
|
||||
<sourceDirectory>src</sourceDirectory>
|
||||
<testSourceDirectory>test</testSourceDirectory>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
||||
@@ -54,7 +54,7 @@ public inline fun <T> comparator(vararg functions: Function1<T,Any?>): Comparato
|
||||
|
||||
private class FunctionComparator<T>(val functions: Array<Function1<T,Any?>>): Comparator<T> {
|
||||
|
||||
public fun toString(): String {
|
||||
public override fun toString(): String {
|
||||
return "FunctionComparator${functions.toList()}"
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public inline fun <T> comparator(fn: (T,T) -> Int): Comparator<T> {
|
||||
}
|
||||
private class Function2Comparator<T>(val compareFn: (T,T) -> Int): Comparator<T> {
|
||||
|
||||
public fun toString(): String {
|
||||
public override fun toString(): String {
|
||||
return "Function2Comparator${compareFn}"
|
||||
}
|
||||
|
||||
@@ -89,4 +89,4 @@ private class Function2Comparator<T>(val compareFn: (T,T) -> Int): Comparator<T
|
||||
public override fun equals(obj: Any?): Boolean {
|
||||
return this == obj
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,7 +320,8 @@ class CollectionTest {
|
||||
assertEquals(0, ArrayList<Double>().count())
|
||||
}
|
||||
|
||||
test fun last() {
|
||||
//todo after KT-1873 the name might be returned to 'last'
|
||||
test fun lastElement() {
|
||||
val data = arrayList("foo", "bar")
|
||||
assertEquals("bar", data.last())
|
||||
assertEquals(25, arrayList(15, 19, 20, 25).last())
|
||||
|
||||
Reference in New Issue
Block a user