[K/N][Tests] Adjust moved codegen tests to new infra

^KT-61259
This commit is contained in:
Vladimir Sukharev
2023-12-14 20:14:47 +01:00
committed by Space Team
parent 71a834b778
commit 73032213f0
295 changed files with 1362 additions and 1145 deletions
@@ -3,24 +3,32 @@
* that can be found in the LICENSE file.
*/
package codegen.function.defaultsWithVarArg1
import kotlin.test.*
val sb = StringBuilder()
fun foo(s: String = "", vararg args: Any) {
if (args == null) {
println("Failed!")
sb.appendLine("Failed!")
} else {
print("$s ")
sb.append("$s ")
args.forEach {
print("$it")
sb.append("$it")
}
println(", Correct!")
sb.appendLine(", Correct!")
}
}
@Test fun runTest() {
fun box(): String {
foo("Hello")
foo("Hello", "World")
foo()
assertEquals("""
Hello , Correct!
Hello World, Correct!
, Correct!
""".trimIndent(), sb.toString())
return "OK"
}