JS backend: added jsCode test cases

This commit is contained in:
Alexey Tsvetkov
2014-12-09 13:46:01 +03:00
parent 97bbcab77d
commit c3f67c54bd
32 changed files with 657 additions and 0 deletions
@@ -0,0 +1,27 @@
package foo
fun testSwitch(number: Int): String = js("""
var result;
switch(number) {
case 1:
result = "one";
break;
case 2:
result = "two";
break;
default:
result = "don't know";
break;
}
return result;
""")
fun box(): String {
assertEquals("one", testSwitch(1))
assertEquals("two", testSwitch(2))
assertEquals("don't know", testSwitch(3))
return "OK"
}