Reformat stdlib tests and samples
#KT-5558
This commit is contained in:
@@ -9,7 +9,7 @@ import test.*
|
||||
import kotlin.reflect.KProperty1
|
||||
import kotlin.test.*
|
||||
|
||||
public fun <T> compare(expected: T, actual: T, block:CompareContext<T>.() -> Unit) {
|
||||
public fun <T> compare(expected: T, actual: T, block: CompareContext<T>.() -> Unit) {
|
||||
CompareContext(expected, actual).block()
|
||||
}
|
||||
|
||||
@@ -26,7 +26,11 @@ public class CompareContext<out T>(public val expected: T, public val actual: T)
|
||||
public fun <P> propertyEquals(message: String = "", getter: T.() -> P) {
|
||||
assertEquals(expected.getter(), actual.getter(), message)
|
||||
}
|
||||
public fun propertyFails(getter: T.() -> Unit) { assertFailEquals({expected.getter()}, {actual.getter()}) }
|
||||
|
||||
public fun propertyFails(getter: T.() -> Unit) {
|
||||
assertFailEquals({ expected.getter() }, { actual.getter() })
|
||||
}
|
||||
|
||||
public fun <P> compareProperty(getter: T.() -> P, block: CompareContext<P>.() -> Unit) {
|
||||
compare(expected.getter(), actual.getter(), block)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user