[JS IR BE] Add a few kotlin.test stubs to IR runtime
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
// IGNORE_BACKEND: JS_IR, NATIVE
|
// IGNORE_BACKEND: NATIVE
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
import kotlin.test.assertTrue
|
import kotlin.test.assertTrue
|
||||||
|
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND: JS_IR
|
|
||||||
// IGNORE_BACKEND: NATIVE
|
// IGNORE_BACKEND: NATIVE
|
||||||
|
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|||||||
@@ -5,7 +5,23 @@
|
|||||||
|
|
||||||
package kotlin.test
|
package kotlin.test
|
||||||
|
|
||||||
|
// This file plugs some declaration from "kotlin.test" library used in tests.
|
||||||
|
|
||||||
fun <T> assertEquals(a: T, b: T) {
|
fun <T> assertEquals(a: T, b: T) {
|
||||||
if (a != b) throw Exception("")
|
if (a != b) throw Exception("")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun assertTrue(x: Boolean) {
|
||||||
|
if (!x) throw Exception("")
|
||||||
|
}
|
||||||
|
|
||||||
|
fun assertFalse(x: Boolean) {
|
||||||
|
if (x) throw Exception("")
|
||||||
|
}
|
||||||
|
|
||||||
|
fun <T : Any> assertNotNull(actual: T?, message: String? = null): T {
|
||||||
|
if (actual == null) throw Exception("")
|
||||||
|
return actual
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user