JS test: added inline tests

This commit is contained in:
Alexey Tsvetkov
2014-09-29 16:00:18 +04:00
committed by Zalim Bashorov
parent 987708680f
commit 3f2d4b31be
112 changed files with 4442 additions and 0 deletions
@@ -0,0 +1,27 @@
package foo
// CHECK_CONTAINS_NO_CALLS: add
data class IntPair(public var fst: Int, public var snd: Int) {
inline public fun getFst(): Int { return fst }
inline public fun setFst(v: Int) { fst = v }
inline public fun getSnd(): Int { return this.snd }
inline public fun setSnd(v: Int) { this.snd = v }
}
fun add(p: IntPair, toFst: Int, toSnd: Int) {
val fst = p.getFst()
p.setFst(fst + toFst)
val snd = p.getSnd()
p.setSnd(snd + toSnd)
}
fun box(): String {
val p = IntPair(0, 0)
add(p, 1, 2)
assertEquals(IntPair(1, 2), p)
return "OK"
}