roundTrip
Encodes and decodes value with the caller's serialization policy.
Compare the result with the original in the owning test:
val decoded = roundTrip(user, { json.encodeToString(it) }, { json.decodeFromString<User>(it) })
assertEquals(user, decoded)Content copied to clipboard
Return
The decoded value.
Parameters
value
The fixture to round-trip.
encode
Serializes a value, including caller-specific formats and naming.
decode
The matching deserializer.