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:
Ilya Matveev
2017-01-12 19:43:20 +07:00
parent d5988297b1
commit 1b553ebfaf
2643 changed files with 66666 additions and 0 deletions
@@ -0,0 +1,35 @@
class JsonObject() {
}
class JsonArray() {
}
public interface Formatter<in IN: Any, out OUT: Any> {
public fun format(source: IN?): OUT
}
public interface MultiFormatter <in IN: Any, out OUT: Any> {
public fun format(source: Collection<IN>): OUT
}
public class Project() {
}
public interface JsonFormatter<in IN: Any>: Formatter<IN, JsonObject>, MultiFormatter<IN, JsonArray> {
public override fun format(source: Collection<IN>): JsonArray {
return JsonArray();
}
}
public class ProjectJsonFormatter(): JsonFormatter<Project> {
public override fun format(source: Project?): JsonObject {
return JsonObject()
}
}
fun box(): String {
val formatter = ProjectJsonFormatter()
return if (formatter.format(Project()) != null) "OK" else "fail"
}