Add test cases for Typed Array
This commit is contained in:
@ -34,6 +34,13 @@ func TestEncoder_WriteSNBT(t *testing.T) {
|
||||
{`[{},{a:1b},{}]`, []byte{9, 0, 0, 10, 0, 0, 0, 3, 0, 1, 0, 1, 'a', 1, 0, 0}},
|
||||
{`[ { } , { a : 1b } , { } ] `, []byte{9, 0, 0, 10, 0, 0, 0, 3, 0, 1, 0, 1, 'a', 1, 0, 0}},
|
||||
{`[[],[]]`, []byte{9, 0, 0, 9, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0}},
|
||||
|
||||
{`[B;]`, []byte{7, 0, 0, 0, 0, 0, 0}},
|
||||
{`[B;1,2,3]`, []byte{7, 0, 0, 0, 0, 0, 3, 1, 2, 3}},
|
||||
{`[I;]`, []byte{11, 0, 0, 0, 0, 0, 0}},
|
||||
{`[I;1,2,3]`, []byte{11, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3}},
|
||||
{`[L;]`, []byte{12, 0, 0, 0, 0, 0, 0}},
|
||||
{`[L;1,2,3]`, []byte{12, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3}},
|
||||
}
|
||||
for i := range testCases {
|
||||
buf.Reset()
|
||||
|
Reference in New Issue
Block a user