Files
kotlin-fork/compiler/testData/codegen/box/ranges/contains/generated/charDownTo.kt
T
Juan Chen 9dd8eda1c9 [FIR]: fix library methods in packages
Library methods such as 'listOf' are resolved
to have the package fragments as their parents,
but JVM expects their containing file classes as parents.
This fix generates those file classes and
uses them as parent replacements for such library methods.
2020-02-20 14:24:02 +03:00

161 lines
8.0 KiB
Kotlin
Vendored

// KJS_WITH_FULL_RUNTIME
// Auto-generated by GenerateInRangeExpressionTestData. Do not edit!
// WITH_RUNTIME
val range0 = '3' downTo '1'
val range1 = '1' downTo '3'
val element0 = '0'
val element1 = '1'
val element2 = '2'
val element3 = '3'
val element4 = '4'
fun box(): String {
testR0xE0()
testR0xE1()
testR0xE2()
testR0xE3()
testR0xE4()
testR1xE0()
testR1xE1()
testR1xE2()
testR1xE3()
testR1xE4()
return "OK"
}
fun testR0xE0() {
// with possible local optimizations
if ('0' in '3' downTo '1' != range0.contains('0')) throw AssertionError()
if ('0' !in '3' downTo '1' != !range0.contains('0')) throw AssertionError()
if (!('0' in '3' downTo '1') != !range0.contains('0')) throw AssertionError()
if (!('0' !in '3' downTo '1') != range0.contains('0')) throw AssertionError()
// no local optimizations
if (element0 in '3' downTo '1' != range0.contains(element0)) throw AssertionError()
if (element0 !in '3' downTo '1' != !range0.contains(element0)) throw AssertionError()
if (!(element0 in '3' downTo '1') != !range0.contains(element0)) throw AssertionError()
if (!(element0 !in '3' downTo '1') != range0.contains(element0)) throw AssertionError()
}
fun testR0xE1() {
// with possible local optimizations
if ('1' in '3' downTo '1' != range0.contains('1')) throw AssertionError()
if ('1' !in '3' downTo '1' != !range0.contains('1')) throw AssertionError()
if (!('1' in '3' downTo '1') != !range0.contains('1')) throw AssertionError()
if (!('1' !in '3' downTo '1') != range0.contains('1')) throw AssertionError()
// no local optimizations
if (element1 in '3' downTo '1' != range0.contains(element1)) throw AssertionError()
if (element1 !in '3' downTo '1' != !range0.contains(element1)) throw AssertionError()
if (!(element1 in '3' downTo '1') != !range0.contains(element1)) throw AssertionError()
if (!(element1 !in '3' downTo '1') != range0.contains(element1)) throw AssertionError()
}
fun testR0xE2() {
// with possible local optimizations
if ('2' in '3' downTo '1' != range0.contains('2')) throw AssertionError()
if ('2' !in '3' downTo '1' != !range0.contains('2')) throw AssertionError()
if (!('2' in '3' downTo '1') != !range0.contains('2')) throw AssertionError()
if (!('2' !in '3' downTo '1') != range0.contains('2')) throw AssertionError()
// no local optimizations
if (element2 in '3' downTo '1' != range0.contains(element2)) throw AssertionError()
if (element2 !in '3' downTo '1' != !range0.contains(element2)) throw AssertionError()
if (!(element2 in '3' downTo '1') != !range0.contains(element2)) throw AssertionError()
if (!(element2 !in '3' downTo '1') != range0.contains(element2)) throw AssertionError()
}
fun testR0xE3() {
// with possible local optimizations
if ('3' in '3' downTo '1' != range0.contains('3')) throw AssertionError()
if ('3' !in '3' downTo '1' != !range0.contains('3')) throw AssertionError()
if (!('3' in '3' downTo '1') != !range0.contains('3')) throw AssertionError()
if (!('3' !in '3' downTo '1') != range0.contains('3')) throw AssertionError()
// no local optimizations
if (element3 in '3' downTo '1' != range0.contains(element3)) throw AssertionError()
if (element3 !in '3' downTo '1' != !range0.contains(element3)) throw AssertionError()
if (!(element3 in '3' downTo '1') != !range0.contains(element3)) throw AssertionError()
if (!(element3 !in '3' downTo '1') != range0.contains(element3)) throw AssertionError()
}
fun testR0xE4() {
// with possible local optimizations
if ('4' in '3' downTo '1' != range0.contains('4')) throw AssertionError()
if ('4' !in '3' downTo '1' != !range0.contains('4')) throw AssertionError()
if (!('4' in '3' downTo '1') != !range0.contains('4')) throw AssertionError()
if (!('4' !in '3' downTo '1') != range0.contains('4')) throw AssertionError()
// no local optimizations
if (element4 in '3' downTo '1' != range0.contains(element4)) throw AssertionError()
if (element4 !in '3' downTo '1' != !range0.contains(element4)) throw AssertionError()
if (!(element4 in '3' downTo '1') != !range0.contains(element4)) throw AssertionError()
if (!(element4 !in '3' downTo '1') != range0.contains(element4)) throw AssertionError()
}
fun testR1xE0() {
// with possible local optimizations
if ('0' in '1' downTo '3' != range1.contains('0')) throw AssertionError()
if ('0' !in '1' downTo '3' != !range1.contains('0')) throw AssertionError()
if (!('0' in '1' downTo '3') != !range1.contains('0')) throw AssertionError()
if (!('0' !in '1' downTo '3') != range1.contains('0')) throw AssertionError()
// no local optimizations
if (element0 in '1' downTo '3' != range1.contains(element0)) throw AssertionError()
if (element0 !in '1' downTo '3' != !range1.contains(element0)) throw AssertionError()
if (!(element0 in '1' downTo '3') != !range1.contains(element0)) throw AssertionError()
if (!(element0 !in '1' downTo '3') != range1.contains(element0)) throw AssertionError()
}
fun testR1xE1() {
// with possible local optimizations
if ('1' in '1' downTo '3' != range1.contains('1')) throw AssertionError()
if ('1' !in '1' downTo '3' != !range1.contains('1')) throw AssertionError()
if (!('1' in '1' downTo '3') != !range1.contains('1')) throw AssertionError()
if (!('1' !in '1' downTo '3') != range1.contains('1')) throw AssertionError()
// no local optimizations
if (element1 in '1' downTo '3' != range1.contains(element1)) throw AssertionError()
if (element1 !in '1' downTo '3' != !range1.contains(element1)) throw AssertionError()
if (!(element1 in '1' downTo '3') != !range1.contains(element1)) throw AssertionError()
if (!(element1 !in '1' downTo '3') != range1.contains(element1)) throw AssertionError()
}
fun testR1xE2() {
// with possible local optimizations
if ('2' in '1' downTo '3' != range1.contains('2')) throw AssertionError()
if ('2' !in '1' downTo '3' != !range1.contains('2')) throw AssertionError()
if (!('2' in '1' downTo '3') != !range1.contains('2')) throw AssertionError()
if (!('2' !in '1' downTo '3') != range1.contains('2')) throw AssertionError()
// no local optimizations
if (element2 in '1' downTo '3' != range1.contains(element2)) throw AssertionError()
if (element2 !in '1' downTo '3' != !range1.contains(element2)) throw AssertionError()
if (!(element2 in '1' downTo '3') != !range1.contains(element2)) throw AssertionError()
if (!(element2 !in '1' downTo '3') != range1.contains(element2)) throw AssertionError()
}
fun testR1xE3() {
// with possible local optimizations
if ('3' in '1' downTo '3' != range1.contains('3')) throw AssertionError()
if ('3' !in '1' downTo '3' != !range1.contains('3')) throw AssertionError()
if (!('3' in '1' downTo '3') != !range1.contains('3')) throw AssertionError()
if (!('3' !in '1' downTo '3') != range1.contains('3')) throw AssertionError()
// no local optimizations
if (element3 in '1' downTo '3' != range1.contains(element3)) throw AssertionError()
if (element3 !in '1' downTo '3' != !range1.contains(element3)) throw AssertionError()
if (!(element3 in '1' downTo '3') != !range1.contains(element3)) throw AssertionError()
if (!(element3 !in '1' downTo '3') != range1.contains(element3)) throw AssertionError()
}
fun testR1xE4() {
// with possible local optimizations
if ('4' in '1' downTo '3' != range1.contains('4')) throw AssertionError()
if ('4' !in '1' downTo '3' != !range1.contains('4')) throw AssertionError()
if (!('4' in '1' downTo '3') != !range1.contains('4')) throw AssertionError()
if (!('4' !in '1' downTo '3') != range1.contains('4')) throw AssertionError()
// no local optimizations
if (element4 in '1' downTo '3' != range1.contains(element4)) throw AssertionError()
if (element4 !in '1' downTo '3' != !range1.contains(element4)) throw AssertionError()
if (!(element4 in '1' downTo '3') != !range1.contains(element4)) throw AssertionError()
if (!(element4 !in '1' downTo '3') != range1.contains(element4)) throw AssertionError()
}