Files
kotlin-fork/compiler/testData/codegen/box/ranges/contains/generated/longDownTo.kt
T
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00

44 lines
1.7 KiB
Kotlin
Vendored

// Auto-generated by GenerateInRangeExpressionTestData. Do not edit!
// WITH_STDLIB
val range0 = 3L downTo 1L
val range1 = 1L downTo 3L
val element0 = 1L
fun box(): String {
testR0xE0()
testR1xE0()
return "OK"
}
fun testR0xE0() {
// with possible local optimizations
if (1L in 3L downTo 1L != range0.contains(1L)) throw AssertionError()
if (1L !in 3L downTo 1L != !range0.contains(1L)) throw AssertionError()
if (!(1L in 3L downTo 1L) != !range0.contains(1L)) throw AssertionError()
if (!(1L !in 3L downTo 1L) != range0.contains(1L)) throw AssertionError()
// no local optimizations
if (element0 in 3L downTo 1L != range0.contains(element0)) throw AssertionError()
if (element0 !in 3L downTo 1L != !range0.contains(element0)) throw AssertionError()
if (!(element0 in 3L downTo 1L) != !range0.contains(element0)) throw AssertionError()
if (!(element0 !in 3L downTo 1L) != range0.contains(element0)) throw AssertionError()
}
fun testR1xE0() {
// with possible local optimizations
if (1L in 1L downTo 3L != range1.contains(1L)) throw AssertionError()
if (1L !in 1L downTo 3L != !range1.contains(1L)) throw AssertionError()
if (!(1L in 1L downTo 3L) != !range1.contains(1L)) throw AssertionError()
if (!(1L !in 1L downTo 3L) != range1.contains(1L)) throw AssertionError()
// no local optimizations
if (element0 in 1L downTo 3L != range1.contains(element0)) throw AssertionError()
if (element0 !in 1L downTo 3L != !range1.contains(element0)) throw AssertionError()
if (!(element0 in 1L downTo 3L) != !range1.contains(element0)) throw AssertionError()
if (!(element0 !in 1L downTo 3L) != range1.contains(element0)) throw AssertionError()
}