kotlin-test: Make assertFailsWith<reified T: Throwable>() common
This commit is contained in:
@@ -45,13 +45,6 @@ private fun <T : Throwable> assertFailsWithImpl(exceptionClass: Class<T>, messag
|
||||
/** Asserts that a [block] fails with a specific exception of type [exceptionClass] being thrown. */
|
||||
impl fun <T : Throwable> assertFailsWith(exceptionClass: KClass<T>, message: String?, block: () -> Unit): T = assertFailsWithImpl(exceptionClass.java, message, block)
|
||||
|
||||
/*
|
||||
/** Asserts that a [block] fails with a specific exception of type [T] being thrown.
|
||||
* Since inline method doesn't allow to trace where it was invoked, it is required to pass a [message] to distinguish this method call from others.
|
||||
*/
|
||||
@InlineOnly
|
||||
inline fun <reified T : Throwable> assertFailsWith(message: String? = null, noinline block: () -> Unit): T = assertFailsWith(T::class, message, block)
|
||||
*/
|
||||
|
||||
/**
|
||||
* Comments out a [block] of test code until it is implemented while keeping a link to the code
|
||||
|
||||
Reference in New Issue
Block a user