TEST: Coercion to Unit and ++/-- tests. (#87)

This commit is contained in:
Nikolay Igotti
2016-11-27 11:22:54 +03:00
committed by GitHub
parent 29c0eda720
commit 3d2166410c
2 changed files with 37 additions and 0 deletions
+5
View File
@@ -398,6 +398,11 @@ task throw0(type: RunKonanTest) {
source = "runtime/basic/throw0.kt"
}
task statements0(type: RunKonanTest) {
goldValue = "239\n238\n30\n29\n"
source = "runtime/basic/statements0.kt"
}
/*
task boxing0(type: RunKonanTest) {
goldValue = "17\n"
@@ -0,0 +1,32 @@
fun simple() {
var a = 238
a++
println(a)
--a
println(a)
}
class Foo() {
var i = 29
fun more() {
i++
}
fun less() {
--i
}
}
fun fields() {
val foo = Foo()
foo.more()
println(foo.i)
foo.less()
println(foo.i)
}
fun main(args: Array<String>) {
simple()
fields()
}