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,30 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test1
// CHECK_CONTAINS_NO_CALLS: test2
inline fun sum(vararg nums: Int): Int {
var result = 0
for (num in nums) {
result += num
}
return result
}
fun test1(): Int {
return sum()
}
fun test2(): Int {
return sum(1,2,3)
}
fun box(): String {
assertEquals(0, test1())
assertEquals(6, test2())
return "OK"
}