Revert "BAEL-4134"

This commit is contained in:
Loredana Crusoveanu
2020-07-07 14:18:10 +03:00
committed by GitHub
parent dffa1f64e6
commit 485b4e3e99
2477 changed files with 9477 additions and 547819 deletions

View File

@@ -6,6 +6,7 @@ interface Page<T> {
fun elements(): MutableList<T>
}
operator fun <T> Page<T>.invoke(index: Int): T = elements()[index]
operator fun <T> Page<T>.get(index: Int): T = elements()[index]
operator fun <T> Page<T>.get(start: Int, endExclusive: Int): List<T> = elements().subList(start, endExclusive)
operator fun <T> Page<T>.set(index: Int, value: T) {

View File

@@ -14,6 +14,11 @@ class PageTest {
assertEquals(page[1, 3], listOf("Kotlin", "Scala"))
}
@Test
fun `Invoke convention should work as expected`() {
assertEquals(page(1), "Kotlin")
}
@Test
fun `In convention should work on a page as expected`() {
assertTrue("Kotlin" in page)