Minor. Use more granular assertion levels in assertion tests
This commit is contained in:
+4
-2
@@ -4,6 +4,8 @@
|
||||
// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm
|
||||
// WITH_RUNTIME
|
||||
|
||||
package localObject
|
||||
|
||||
interface Checker {
|
||||
fun checkTrue(): Boolean
|
||||
fun checkFalse(): Boolean
|
||||
@@ -129,8 +131,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("localObject", v)
|
||||
val c = loader.loadClass(if (v) "localObject.ShouldBeEnabled" else "localObject.ShouldBeDisabled")
|
||||
return c.newInstance() as Checker
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user