tape: Test troublesome data structure

This commit is contained in:
Sasha Koshka 2025-10-12 18:41:32 -04:00
parent ba2dc6b53f
commit c3d0f33700

View File

@ -27,6 +27,12 @@ var samplePayloads = [][]byte {
0x02, 0x23, byte(LSI.WithCN(1)), 0x45, 0x67,
0x02, 0x24, byte(LI.WithCN(3)), 0x45, 0x67, 0x89, 0xAB,
},
/* map[uint16] any */ []byte {
byte(KTV.WithCN(0)), 3,
0x00, 0x01, 0x63, 0x43, 0xF4, 0xC0, 0x00,
0x00, 0x02, 0x82, 'h', 'i',
0x00, 0x03, 0x21, 0x39, 0x92,
},
}
var sampleValues = []any {
@ -49,6 +55,11 @@ var sampleValues = []any {
0x0223: int16(0x4567),
0x0224: uint32(0x456789AB),
},
/* map[uint16] any */ map[uint16] any {
0x0001: float32(489.5),
0x0002: "hi",
0x0003: uint16(0x3992),
},
}
type userDefinedInteger int16
@ -195,7 +206,7 @@ func TestDecodeWrongType(test *testing.T) {
{ var dest []string; arrayCase(&dest) }
}
// tables should only assign to other tables
if index != 12 {
if index != 12 && index != 13 {
test.Log("- map[uint16] any")
{ var dest = map[uint16] any { }; arrayCase(&dest) }
}