JS: move more test to box tests

This commit is contained in:
Alexey Andreev
2016-08-30 14:59:26 +03:00
parent 7e2d5b04de
commit 3801052460
112 changed files with 760 additions and 676 deletions
@@ -0,0 +1,28 @@
package foo
var c1 = 0;
fun getInt(): Int? {
c1++
return c1
}
fun getNullInt(): Int? = null
fun box(): String {
if (c1 != 0) {
return "Start value of counter not 0, it: $c1"
}
val nullRes = getNullInt()?.toString()
if (nullRes != null) {
return "Broken safeCall. nullRes: $nullRes"
}
val res = getInt()?.toString()
if (res != "1") {
return "res != 1, it: $res, and c1: $c1"
}
if (c1 != 1) {
return "Side effect. c1 != 1, it: $c1"
}
return "OK"
}