Fix flaky metadata decoding test

This commit is contained in:
Torsten Grote 2024-02-02 10:23:28 -03:00 committed by Chirayu Desai
parent fcbd62ba3b
commit cb9d3c701b

View file

@ -26,7 +26,10 @@ internal class MetadataWriterDecoderTest {
@Test
fun `encoded metadata matches decoded metadata (no packages)`() {
val metadata = getMetadata()
val metadata = getMetadata().let {
if (it.version == 0.toByte()) it.copy(salt = "") // no salt in version 0
else it
}
assertEquals(
metadata,
decoder.decode(encoder.encode(metadata), metadata.version, metadata.token)