Add ir interpreter tests

This commit is contained in:
Ivan Kylchik
2021-05-19 16:27:03 +03:00
committed by TeamCityServer
parent cc2d7340dc
commit e28ab45c51
115 changed files with 5104 additions and 0 deletions
@@ -0,0 +1,7 @@
import kotlin.collections.*
import kotlin.sequences.*
const val a = intArrayOf(1, 2, 3).<!EVALUATED: `true`!>contains(1)<!>
const val b = intArrayOf(1, 2, 3).<!EVALUATED: `false`!>contains(4)<!>
const val c = arrayOf(1, "2", 3.0).<!EVALUATED: `true`!>contains("2")<!>
const val d = sequenceOf(1, 2, 3).<!EVALUATED: `true`!>contains(2)<!>
@@ -0,0 +1,9 @@
import kotlin.*
import kotlin.collections.*
import kotlin.text.*
const val a = listOf(1, 2, 3).<!EVALUATED: `2`!>elementAtOrElse(1) { -1 }<!>
const val b = listOf(1, 2, 3).<!EVALUATED: `-1`!>elementAtOrElse(4) { -1 }<!>
const val c = uintArrayOf(1u, 2u, 3u, 4u).<!EVALUATED: `3`!>elementAtOrElse(2) { 0u }<!>
const val d = "abcd".<!EVALUATED: `c`!>elementAtOrElse(2) { '0' }<!>
const val e = "abcd".<!EVALUATED: `0`!>elementAtOrElse(4) { '0' }<!>
@@ -0,0 +1,11 @@
import kotlin.*
import kotlin.collections.*
import kotlin.text.*
const val a = "abcs".<!EVALUATED: `a`!>first()<!>
const val b = UIntArray(3) { it.toUInt() }.<!EVALUATED: `0`!>first()<!>
const val c = <!EVALUATED: `1`!>listOf(1, "2", 3.0).first() as Int<!>
const val d = listOf<Int>().<!WAS_NOT_EVALUATED: `
Exception java.util.NoSuchElementException: List is empty.
at CollectionsKt.kotlin.collections.first(Collections.kt:88)
at FirstKt.<clinit>(first.kt:8)`!>first()<!>
@@ -0,0 +1,5 @@
import kotlin.collections.*
import kotlin.sequences.*
const val a = listOf(1, 2, 3).<!EVALUATED: `1, 2, 3`!>joinToString()<!>
const val b = sequenceOf(-1, -2, -3).<!EVALUATED: `-1.-2.-3`!>joinToString(separator = ".")<!>
@@ -0,0 +1,16 @@
import kotlin.*
import kotlin.collections.*
import kotlin.text.*
import kotlin.sequences.*
const val zeroElementIntArrayToList = intArrayOf().toList().<!EVALUATED: `0`!>size<!>
const val singleElementIntArrayToList = intArrayOf(1).toList().<!EVALUATED: `1`!>size<!>
const val intArrayToList = intArrayOf(1, 2, 3).toList().<!EVALUATED: `3`!>size<!>
const val customArrayToList = <!EVALUATED: `Some other value`!>arrayOf(1, "2", 3.0, "Some other value").toList()[3] as String<!>
const val listFromSet = setOf(1, 2, 2, 3, 3).toList().<!EVALUATED: `1, 2, 3`!>joinToString()<!>
const val listFromIterable = mapOf(1 to "One", 2 to "Two", 3 to "Three").entries.toList().<!EVALUATED: `1=One, 2=Two, 3=Three`!>joinToString()<!>
const val stringToList = "String".toList().<!EVALUATED: `S, t, r, i, n, g`!>joinToString()<!>
const val sequenceToList = sequenceOf(3, 2, 1).toList().<!EVALUATED: `3, 2, 1`!>joinToString()<!>
@@ -0,0 +1,5 @@
import kotlin.text.*
const val trimmed = " 1 ".<!EVALUATED: `1`!>trim()<!>
const val trimmedWithPredicate = (" 2 " as CharSequence).trim { it.isWhitespace() }.<!EVALUATED: `2`!>toString()<!>
const val charSequenceTrim = (" 3 " as CharSequence).trim().<!EVALUATED: `3`!>toString()<!>