Skip to content

Commit b460395

Browse files
committed
add test case for TestEncodeSlice function
1 parent 9e35285 commit b460395

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

encoding_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ func TestEncode(t *testing.T) {
5252
}
5353

5454
func TestEncodeSlice(t *testing.T) {
55+
slice := EncodeSlice([]uint64{1, 127, 0, 255, 256})
56+
assert.Equal(t, []byte{
57+
0x1, // 1
58+
0x7f, // 127
59+
0x0, // 0
60+
0xff, 0x1, // 255
61+
0x80, 0x2, // 256
62+
}, slice)
5563
}
5664

5765
func TestDecode(t *testing.T) {

0 commit comments

Comments
 (0)