mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
29 lines
681 B
Kotlin
Vendored
29 lines
681 B
Kotlin
Vendored
class P(val actual: String, val expected: String)
|
|
fun array(vararg s: P) = s
|
|
|
|
fun box() : String {
|
|
val data = array(
|
|
P("""""", ""),
|
|
P(""""""", "\""),
|
|
P("""""""", "\"\""),
|
|
P(""""""""", "\"\"\""),
|
|
P("""""""""", "\"\"\"\""),
|
|
P("""" """, "\" "),
|
|
P(""""" """, "\"\" "),
|
|
P(""" """", " \""),
|
|
P(""" """"", " \"\""),
|
|
P(""" """""", " \"\"\""),
|
|
P(""" """"""", " \"\"\"\""),
|
|
P(""" """""""", " \"\"\"\"\""),
|
|
P("""" """", "\" \""),
|
|
P(""""" """"", "\"\" \"\"")
|
|
)
|
|
|
|
for (i in 0..data.size-1) {
|
|
val p = data[i]
|
|
if (p.actual != p.expected) return "Fail at #$i. actual='${p.actual}', expected='${p.expected}'"
|
|
}
|
|
|
|
return "OK"
|
|
}
|