applied pull request with thanks https://github.com/JetBrains/kotlin/pull/46
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package test.collections
|
||||
|
||||
import java.util.ArrayList
|
||||
import kotlin.test.*
|
||||
import org.junit.Test as test
|
||||
|
||||
@@ -36,4 +37,12 @@ class ListTest {
|
||||
}
|
||||
assertEquals(data.size(), index)
|
||||
}
|
||||
|
||||
test fun lastIndex() {
|
||||
val emptyData = ArrayList<String>()
|
||||
val data = arrayList("foo", "bar")
|
||||
|
||||
assertEquals(-1, emptyData.lastIndex)
|
||||
assertEquals(1, data.lastIndex)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user