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:
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user