JS: create new common directory for all generated tests, migrate several tests there

This commit is contained in:
Alexey Andreev
2016-08-26 16:44:48 +03:00
parent 34a57f863b
commit 2bf0199959
321 changed files with 2123 additions and 2001 deletions
+36
View File
@@ -0,0 +1,36 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test1
// CHECK_CONTAINS_NO_CALLS: test2
// CHECK_CONTAINS_NO_CALLS: test3 except=slice
internal inline fun concat(vararg strings: String): String {
var result = ""
for (string in strings) {
result += string
}
return result
}
internal fun test1(): String {
return concat()
}
internal fun test2(): String {
return concat("a", "b", "c")
}
internal fun test3(list: Array<String>): String {
return concat(*list)
}
fun box(): String {
assertEquals("", test1())
assertEquals("abc", test2())
assertEquals("abcd", test3(arrayOf("a", "b", "c", "d")))
return "OK"
}