Files
kotlin-fork/backend.native/tests/external/codegen/blackbox/strings/rawStringsWithManyQuotes.kt
T
Ilya Matveev 1b553ebfaf 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.
2017-01-20 14:04:04 +03:00

29 lines
681 B
Kotlin

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"
}