KT-31639: Fix Iterables.drop integer overflow

This commit is contained in:
Eduard Wolf
2019-05-27 19:16:13 +02:00
committed by Ilya Gorbunov
parent e5565b817b
commit c885cadde4
3 changed files with 8 additions and 2 deletions
@@ -156,4 +156,10 @@ class IndexOverflowJVMTest {
assertEquals(expectedEnd, dropTake.last())
}
@Test
fun dropMaxValue() {
val range = 0L..Int.MAX_VALUE + 1L
assertEquals(listOf(Int.MAX_VALUE.toLong(), Int.MAX_VALUE + 1L), range.drop(Int.MAX_VALUE))
}
}