BC native tests port to Konan's TestRunner

This commit is contained in:
Pavel Punegov
2017-10-11 15:09:33 +03:00
parent 9b07fd61ce
commit 9d077d7f4f
352 changed files with 1798 additions and 384 deletions
+5 -1
View File
@@ -1,3 +1,7 @@
package runtime.text.chars0
import kotlin.test.*
fun assertTrue(v: Boolean) = if (!v) throw AssertionError() else Unit
fun assertFalse(v: Boolean) = if (v) throw AssertionError() else Unit
fun assertEquals(a: Int, b: Int) { if (a != b) throw AssertionError() }
@@ -103,7 +107,7 @@ fun testCategory() {
} catch (e: IllegalArgumentException) {}
}
fun main(args: Array<String>) {
@Test fun runTest() {
testIsSurrogatePair()
testToChars()
testToCodePoint()
+5 -1
View File
@@ -1,4 +1,8 @@
fun main(args: Array<String>) {
package runtime.text.parse0
import kotlin.test.*
@Test fun runTest() {
println("false".toBoolean())
println("true".toBoolean())
println("-1".toByte())
+5 -1
View File
@@ -1,4 +1,8 @@
fun main(args: Array<String>) {
package runtime.text.string0
import kotlin.test.*
@Test fun runTest() {
val str = "hello"
println(str.equals("HElLo", true))
val strI18n = "Привет"
@@ -1,3 +1,7 @@
package runtime.text.string_builder0
import kotlin.test.*
// Utils ====================================================================================================
fun assertTrue(cond: Boolean) {
if (!cond)
@@ -262,7 +266,7 @@ fun testBasic() {
assertEquals("", sb.toString())
}
fun main(args : Array<String>) {
@Test fun runTest() {
testBasic()
testInsert()
testReverse()
@@ -1,4 +1,8 @@
fun main(arg:Array<String>) {
package runtime.text.string_builder1
import kotlin.test.*
@Test fun runTest() {
val a = StringBuilder()
a.append("Hello").appendln("Kotlin").appendln(42).appendln(0.1).appendln(true)
println(a.toString())
@@ -1,3 +1,7 @@
package runtime.text.to_string0
import kotlin.test.*
// Based on Apache Harmony tests.
fun assertEquals(actual: String, expected: String, msg: String) {
@@ -34,7 +38,7 @@ fun testLongToStringWithRadix() {
}
fun main(args: Array<String>) {
@Test fun runTest() {
testIntToStringWithRadix()
testLongToStringWithRadix()
println("OK")