File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
sdk/src/test/config/sc/helpers Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package sc.helpers
3
3
import com.thoughtworks.xstream.XStream
4
4
import io.kotest.core.listeners.ProjectListener
5
5
import io.kotest.core.spec.AutoScan
6
- import io.kotest.matchers.shouldBe
6
+ import io.kotest.matchers.*
7
7
import sc.networking.XStreamProvider
8
8
9
9
@AutoScan
@@ -13,11 +13,16 @@ object XStreamProjectListener: ProjectListener {
13
13
}
14
14
}
15
15
16
+ /* * An XStream instance initialized with all active plugins. */
16
17
lateinit var testXStream: XStream
17
18
19
+ /* * Asserts that the object is serialized to the given String
20
+ * and is equal to the original after deserialization. */
18
21
inline infix fun <reified T : Any > T.shouldSerializeTo (serialized : String ) =
19
22
checkSerialization(testXStream, this , serialized.trimIndent())
20
23
24
+ /* * Asserts that the object is serialized to the given String.
25
+ * @param matcher checks the deserialized object, by default via equals and hashCode */
21
26
inline fun <reified T : Any > checkSerialization (
22
27
xStream : XStream , obj : T , serialized : String ,
23
28
matcher : (obj: T , deserialized: T ) -> Unit = { original, deserialized ->
You can’t perform that action at this time.
0 commit comments