backend/tests: Add blackbox tests from Kotlin JVM
Added tests from testData/codegen/box directory. There are blackbox tests in other directories and they are to be added.
This commit is contained in:
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
public inline fun <T> T.with(f: T.() -> Unit): T {
|
||||
this.f()
|
||||
return this
|
||||
}
|
||||
|
||||
public class Cls {
|
||||
val string = "Cls"
|
||||
val buffer = StringBuilder().with {
|
||||
append(string)
|
||||
}
|
||||
}
|
||||
|
||||
public object Obj {
|
||||
val string = "Obj"
|
||||
val buffer = StringBuilder().with {
|
||||
append(string)
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
if (Cls().buffer.toString() != "Cls") return "Fail class"
|
||||
if (Obj.buffer.toString() != "Obj") return "Fail object"
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user