[JS IR BE] Add a few kotlin.test stubs to IR runtime

This commit is contained in:
Svyatoslav Kuzmich
2019-01-27 02:48:04 +03:00
parent b49ec3edb8
commit b239c80531
3 changed files with 17 additions and 2 deletions
@@ -1,4 +1,4 @@
// IGNORE_BACKEND: JS_IR, NATIVE
// IGNORE_BACKEND: NATIVE
// WITH_RUNTIME
import kotlin.test.assertTrue
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: NATIVE
// WITH_RUNTIME
+16
View File
@@ -5,7 +5,23 @@
package kotlin.test
// This file plugs some declaration from "kotlin.test" library used in tests.
fun <T> assertEquals(a: T, b: T) {
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
}