Make Regex class serializable on JVM

#KT-16447 Fixed

Refactor helper functions for serialization tests.
This commit is contained in:
Ilya Gorbunov
2017-04-22 02:24:17 +03:00
parent 99bd54116e
commit 16d3d2f764
6 changed files with 80 additions and 13 deletions
@@ -1,6 +1,7 @@
package test.collections
import test.*
import kotlin.reflect.KProperty1
import kotlin.test.*
public fun <T> compare(expected: T, actual: T, block:CompareContext<T>.() -> Unit) {
@@ -12,6 +13,11 @@ public class CompareContext<out T>(public val expected: T, public val actual: T)
public fun equals(message: String = "") {
assertEquals(expected, actual, message)
}
public fun <P> propertyEquals(property: KProperty1<in T, P>) {
propertyEquals(property.name, property)
}
public fun <P> propertyEquals(message: String = "", getter: T.() -> P) {
assertEquals(expected.getter(), actual.getter(), message)
}