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,12 @@
@CompileTimeCalculation
class MyCharSequence(val str: String): CharSequence {
override val length: Int = str.length
override fun get(index: Int) = str[index]
override fun subSequence(startIndex: Int, endIndex: Int) = str.subSequence(startIndex, endIndex)
}
const val sbSize = StringBuilder(MyCharSequence("MyString")).<!EVALUATED: `8`!>length<!>
const val appendSize = StringBuilder().append(MyCharSequence("MyString")).<!EVALUATED: `8`!>length<!>
const val subSequenceSize = StringBuilder(StringBuilder(MyCharSequence("MyString")).subSequence(0, 4)).<!EVALUATED: `4`!>length<!>