diff --git a/src/commonTest/kotlin/bipack/BipackEncoderTest.kt b/src/commonTest/kotlin/bipack/BipackEncoderTest.kt index 1d35c50..304b116 100644 --- a/src/commonTest/kotlin/bipack/BipackEncoderTest.kt +++ b/src/commonTest/kotlin/bipack/BipackEncoderTest.kt @@ -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(packed).i.toInt()) + } + t1(127) + t1(-127) + t1(1) + t1(-1) + } } \ No newline at end of file