generate: Test array encoding

This commit is contained in:
Sasha Koshka 2025-07-20 23:21:59 -04:00
parent 0f626b2e93
commit ad3973dd9e

View File

@ -235,5 +235,41 @@ func TestGenerateRun(test *testing.T) {
[]byte { 0x00, 0x00, 0x66, 'r', 'a', 'r', 'i', 't', 'y' },
[]byte { 0x00, 0x01, 0x64, 'g', 'e', 'm', 's' },
))
messageUserList := MessageUserList {
Users: []User {
User {
Name: "rarity",
Bio: "asdjads",
Followers: 0x324,
},
User {
Name: "deez nuts",
Bio: "logy",
Followers: 0x8000,
},
User {
Name: "creekflow",
Bio: "im creekflow",
Followers: 0x3894,
},
},
}
testEncode(
&messageUserList,
tu.S(0xC1, 0x01, 0x00, 0x00,
0xA1, 0x03, 0xC1,
0x03,
0x00, 0x00, 0x66, 'r', 'a', 'r', 'i', 't', 'y',
0x00, 0x01, 0x67, 'a', 's', 'd', 'j', 'a', 'd', 's',
0x00, 0x02, 0x23, 0x00, 0x00, 0x03, 0x24,
0x03,
0x00, 0x00, 0x69, 'd', 'e', 'e', 'z', ' ', 'n', 'u', 't', 's',
0x00, 0x01, 0x64, 'l', 'o', 'g', 'y',
0x00, 0x02, 0x23, 0x00, 0x00, 0x80, 0x00,
0x03,
0x00, 0x00, 0x69, 'c', 'r', 'e', 'e', 'k', 'f', 'l', 'o', 'w',
0x00, 0x01, 0x6C, 'i', 'm', ' ', 'c', 'r', 'e', 'e', 'k', 'f', 'l', 'o', 'w',
0x00, 0x02, 0x23, 0x00, 0x00, 0x38, 0x94,
))
`)
}