JS test: added inline tests
This commit is contained in:
committed by
Zalim Bashorov
parent
987708680f
commit
3f2d4b31be
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user