Skip to content

Commit 2924e05

Browse files
committed
docs(sdk): document XStreamMatcher.kt
1 parent ba660a8 commit 2924e05

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sdk/src/test/config/sc/helpers/XStreamMatcher.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package sc.helpers
33
import com.thoughtworks.xstream.XStream
44
import io.kotest.core.listeners.ProjectListener
55
import io.kotest.core.spec.AutoScan
6-
import io.kotest.matchers.shouldBe
6+
import io.kotest.matchers.*
77
import sc.networking.XStreamProvider
88

99
@AutoScan
@@ -13,11 +13,16 @@ object XStreamProjectListener: ProjectListener {
1313
}
1414
}
1515

16+
/** An XStream instance initialized with all active plugins. */
1617
lateinit var testXStream: XStream
1718

19+
/** Asserts that the object is serialized to the given String
20+
* and is equal to the original after deserialization. */
1821
inline infix fun <reified T: Any> T.shouldSerializeTo(serialized: String) =
1922
checkSerialization(testXStream, this, serialized.trimIndent())
2023

24+
/** Asserts that the object is serialized to the given String.
25+
* @param matcher checks the deserialized object, by default via equals and hashCode */
2126
inline fun <reified T: Any> checkSerialization(
2227
xStream: XStream, obj: T, serialized: String,
2328
matcher: (obj: T, deserialized: T) -> Unit = { original, deserialized ->

0 commit comments

Comments
 (0)