Remove internal visibility suppressions in kotlin.test
Internal visibility works fine in MPP, so they are no longer required.
This commit is contained in:
@@ -197,7 +197,6 @@ private fun checkFailedAssertion(assertion: () -> Unit) {
|
||||
assertFailsWith<AssertionError> { withDefaultAsserter(assertion) }
|
||||
}
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER")
|
||||
private fun withDefaultAsserter(block: () -> Unit) {
|
||||
val current = overrideAsserter(DefaultAsserter)
|
||||
try {
|
||||
|
||||
@@ -28,7 +28,6 @@ actual fun todo(block: () -> Unit) {
|
||||
*/
|
||||
actual fun <T : Throwable> assertFailsWith(exceptionClass: KClass<T>, message: String?, block: () -> Unit): T {
|
||||
val exception = assertFails(message, block)
|
||||
@Suppress("INVISIBLE_MEMBER")
|
||||
assertTrue(exceptionClass.isInstance(exception), messagePrefix(message) + "Expected an exception of $exceptionClass to be thrown, but was $exception")
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
@file:kotlin.jvm.JvmMultifileClass
|
||||
@file:kotlin.jvm.JvmName("AssertionsKt")
|
||||
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
|
||||
|
||||
package kotlin.test
|
||||
|
||||
@@ -22,11 +21,9 @@ private fun <T : Throwable> assertFailsWithImpl(exceptionClass: Class<T>, messag
|
||||
return e as T
|
||||
}
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER")
|
||||
asserter.fail(messagePrefix(message) + "Expected an exception of $exceptionClass to be thrown, but was $e")
|
||||
}
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER")
|
||||
val msg = messagePrefix(message)
|
||||
asserter.fail(msg + "Expected an exception of $exceptionClass to be thrown, but was completed successfully.")
|
||||
}
|
||||
@@ -49,6 +46,7 @@ actual fun <T : Throwable> assertFailsWith(exceptionClass: KClass<T>, message: S
|
||||
*
|
||||
* This keeps the code under test referenced, but doesn't actually test it until it is implemented.
|
||||
*/
|
||||
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
|
||||
@InlineOnly
|
||||
actual inline fun todo(@Suppress("UNUSED_PARAMETER") block: () -> Unit) {
|
||||
println("TODO at " + currentStackTrace()[0])
|
||||
@@ -59,7 +57,7 @@ actual inline fun todo(@Suppress("UNUSED_PARAMETER") block: () -> Unit) {
|
||||
* The first element of the array (assuming the array is not empty) represents the top of the
|
||||
* stack, which is the place where [currentStackTrace] function was called from.
|
||||
*/
|
||||
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN")
|
||||
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
|
||||
@InlineOnly
|
||||
inline fun currentStackTrace() = (java.lang.Exception() as java.lang.Throwable).stackTrace
|
||||
inline fun currentStackTrace() = @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") (java.lang.Exception() as java.lang.Throwable).stackTrace
|
||||
|
||||
|
||||
Reference in New Issue
Block a user