Generate test data for in-expression tests, fix bug with indices

This commit is contained in:
Dmitry Petrov
2017-07-12 11:56:03 +03:00
parent 890c6a9983
commit 6a673a03e4
25 changed files with 11651 additions and 128 deletions
@@ -0,0 +1,43 @@
// Auto-generated by GenerateInRangeExpressionTestData. Do not edit!
// WITH_RUNTIME
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()
}