Drop deprecations in kotlin.test
This commit is contained in:
@@ -4,9 +4,6 @@ package kotlin.test
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
@Deprecated("Use assertFailsWith instead.", ReplaceWith("assertFailsWith(exceptionClass, block)"), kotlin.DeprecationLevel.ERROR)
|
||||
fun <T : Throwable> failsWith(exceptionClass: Class<T>, block: () -> Any): T = assertFailsWith(exceptionClass) { block() }
|
||||
|
||||
/** Asserts that a [block] fails with a specific exception being thrown. */
|
||||
fun <T : Throwable> assertFailsWith(exceptionClass: Class<T>, block: () -> Unit): T {
|
||||
return assertFailsWith(exceptionClass, null, block)
|
||||
|
||||
@@ -8,15 +8,6 @@ package kotlin.test
|
||||
|
||||
import kotlin.internal.*
|
||||
|
||||
|
||||
/** Asserts that the given [block] returns `false`. */
|
||||
@Deprecated("Use assertFalse instead.", ReplaceWith("assertFalse(message, block)"), kotlin.DeprecationLevel.ERROR)
|
||||
fun assertNot(message: String, block: () -> Boolean): Unit = assertFalse(message, block)
|
||||
|
||||
/** Asserts that the given [block] returns `false`. */
|
||||
@Deprecated("Use assertFalse instead.", ReplaceWith("assertFalse(null, block)"), kotlin.DeprecationLevel.ERROR)
|
||||
fun assertNot(block: () -> Boolean): Unit = assertFalse(block = block)
|
||||
|
||||
/** Asserts that the given [block] returns `true`. */
|
||||
fun assertTrue(message: String? = null, block: () -> Boolean): Unit = assertTrue(block(), message)
|
||||
|
||||
@@ -77,9 +68,6 @@ fun <@OnlyInputTypes T> expect(expected: T, message: String?, block: () -> T) {
|
||||
assertEquals(expected, block(), message)
|
||||
}
|
||||
|
||||
@Deprecated("Use assertFails instead.", ReplaceWith("assertFails(block)"), kotlin.DeprecationLevel.ERROR)
|
||||
fun fails(block: () -> Unit): Throwable? = assertFails(block)
|
||||
|
||||
/** Asserts that given function [block] fails by throwing an exception. */
|
||||
fun assertFails(block: () -> Unit): Throwable {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user