[Wasm] stdlib API: make kotlin.assert internal
Being disabled by default and not well-documented, these functions cause confusion among early adopters as to why their code don't work properly. Assert APIs need a proper design across Kotlin platforms. Since APIs are not available in common code and K/JS, it is premature to have such a general feature in a new experimental platform. Compiler tests: * Mute tests that rely on assert. * Replace JVM-specific assert calls with require calls and unmute passed K/JS tests. Merge-request: KT-MR-8636 Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
a8f547d080
commit
abf70a586c
+2
-2
@@ -15,10 +15,10 @@ fun dougleRange(x: Double?, y: Double) = x?.rangeTo(y)
|
||||
|
||||
inline fun <reified T, R> testSafeRange(x: T, y: T, expectStr: String, safeRange: (T?, T) -> R?) {
|
||||
val rNull = safeRange(null, y)
|
||||
assert (rNull == null) { "${T::class.simpleName}: Expected: null, got $rNull" }
|
||||
require (rNull == null) { "${T::class.simpleName}: Expected: null, got $rNull" }
|
||||
|
||||
val rxy = safeRange(x, y)
|
||||
assert (rxy?.toString() == expectStr) { "${T::class.simpleName}: Expected: $expectStr, got $rxy" }
|
||||
require (rxy?.toString() == expectStr) { "${T::class.simpleName}: Expected: $expectStr, got $rxy" }
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
Reference in New Issue
Block a user