BC native tests port to Konan's TestRunner
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user