mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
Remove deprecated ranges from tests and take into account that Byte and Short rangeTo now returns IntRange.
This commit is contained in:
@@ -11,27 +11,19 @@ inline fun <R, T : Iterable<R>> foo(x : T, block : (R) -> R) : R {
|
||||
fun bar() {
|
||||
foo((1..100)) { x -> x + 1 }
|
||||
foo((1L..100L)) { x -> x + 1 }
|
||||
foo((1.0.toDouble()..2.0.toDouble())) { x -> x + 1 }
|
||||
foo((1.0f..2.0f)) { x -> x + 1 }
|
||||
foo((1.toByte()..100.toByte())) { x -> x }
|
||||
foo((1.toShort()..100.toShort())) { x -> x }
|
||||
foo(('a'..'z')) { x -> x }
|
||||
|
||||
foo(IntRange(1, 100)) { x -> x + 1 }
|
||||
foo(LongRange(1L, 100L)) { x -> x + 1 }
|
||||
foo(DoubleRange(1.0, 2.0)) { x -> x + 1 }
|
||||
foo(FloatRange(1.0f, 2.0f)) { x -> x + 1 }
|
||||
foo(ByteRange(1.toByte(), 100.toByte())) { x -> x }
|
||||
foo(ShortRange(1.toShort(), 100.toShort())) { x -> x }
|
||||
foo(CharRange('a', 'z')) { x -> x }
|
||||
}
|
||||
|
||||
// 1 next\s\(
|
||||
// 2 nextInt
|
||||
// 4 nextInt
|
||||
// 2 nextLong
|
||||
// 2 nextDouble
|
||||
// 2 nextFloat
|
||||
// 2 nextByte
|
||||
// 2 nextShort
|
||||
// 0 nextByte
|
||||
// 0 nextShort
|
||||
// 2 nextChar
|
||||
// 0 Value\s\(\)
|
||||
|
||||
Reference in New Issue
Block a user