Minor. Use more granular assertion levels in assertion tests

This commit is contained in:
Ilmir Usmanov
2018-08-06 17:11:32 +03:00
parent 1a1bb53381
commit b4189d9e85
18 changed files with 74 additions and 46 deletions
+4 -2
View File
@@ -4,6 +4,8 @@
// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm
// WITH_RUNTIME
package localFunction
interface Checker {
fun checkTrue(): Boolean
fun checkFalse(): Boolean
@@ -97,8 +99,8 @@ class ShouldBeEnabled : Checker {
fun setDesiredAssertionStatus(v: Boolean): Checker {
val loader = Checker::class.java.classLoader
loader.setDefaultAssertionStatus(v)
val c = loader.loadClass(if (v) "ShouldBeEnabled" else "ShouldBeDisabled")
loader.setPackageAssertionStatus("localFunction", v)
val c = loader.loadClass(if (v) "localFunction.ShouldBeEnabled" else "localFunction.ShouldBeDisabled")
return c.newInstance() as Checker
}