added test case for KT-2354

This commit is contained in:
James Strachan
2012-07-03 13:55:49 +01:00
parent 32e73c10b1
commit 25bf753369
6 changed files with 98 additions and 1 deletions
+20
View File
@@ -2,6 +2,26 @@ package kotlin
import java.util.*
public inline fun <T> java.lang.Iterable<T>.toString(): String {
return makeString(", ", "[", "]")
}
public inline fun <T> java.util.List<T>.equals(that: List<T>): Boolean {
val s1 = this.size()
val s2 = that.size()
if (s1 == s2) {
for (i in 0.upto(s1)) {
val elem1 = this.get(i)
val elem2 = that.get(i)
if (elem1 != elem2) {
return false
}
}
return true
}
return false
}
/** Returns a new ArrayList with a variable number of initial elements */
public inline fun arrayList<T>(vararg values: T) : ArrayList<T> {
val list = ArrayList<T>()