kotlin-test: Make 'todo { }' function common
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
package kotlin.test
|
||||
|
||||
/**
|
||||
* Comments out a block of test code until it is implemented while keeping a link to the code
|
||||
* to implement in your unit test output
|
||||
*/
|
||||
header fun todo(block: () -> Unit)
|
||||
@@ -20,7 +20,7 @@ package kotlin.test
|
||||
* Comments out a block of test code until it is implemented while keeping a link to the code
|
||||
* to implement in your unit test output
|
||||
*/
|
||||
fun todo(block: () -> Any) {
|
||||
impl fun todo(block: () -> Unit) {
|
||||
// println("TODO at " + (Exception() as java.lang.Throwable).getStackTrace()?.get(1) + " for " + block)
|
||||
println("TODO at " + block)
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ inline fun <reified T : Throwable> assertFailsWith(message: String? = null, noin
|
||||
* to implement in your unit test output
|
||||
*/
|
||||
@InlineOnly
|
||||
inline fun todo(@Suppress("UNUSED_PARAMETER") block: () -> Unit) {
|
||||
impl inline fun todo(@Suppress("UNUSED_PARAMETER") block: () -> Unit) {
|
||||
System.out.println("TODO at " + currentStackTrace()[0])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user