readme fix

This commit is contained in:
Sergey Chernov 2024-08-24 07:14:10 +02:00
parent 988974230d
commit a4cf3fe8ee

View File

@ -30,6 +30,7 @@ data class Foobar2(val bar: Int, val foo: Int, val other: Int = -1)
@Framed
data class FoobarF1(val bar: Int, val foo: Int = 117)
@Suppress("unused")
@Serializable
@Framed
@SerialName("bipack.FoobarF1")
@ -440,4 +441,21 @@ class BipackEncoderTest {
println(y)
}
@Serializable
data class T1(@Fixed val i: Byte)
@Test
fun testFixedByte() {
fun t1(i: Int) {
val packed = BipackEncoder.encode(T1(i.toByte()))
println(packed.toDump())
assertEquals(1, packed.size)
assertEquals(i, BipackDecoder.decode<T1>(packed).i.toInt())
}
t1(127)
t1(-127)
t1(1)
t1(-1)
}
}