[K/N][Tests] Adjust moved codegen tests to new infra
^KT-61259
This commit is contained in:
committed by
Space Team
parent
71a834b778
commit
73032213f0
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user