MCPcopy Create free account
hub / github.com/distributedio/titan / TestArray_Decode

Function TestArray_Decode

encoding/resp/resp_test.go:10–22  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestArray_Decode(t *testing.T) {
11 assert := assert.New(t)
12 r := bytes.NewBufferString("*1\r\n$5\r\nhello\r\nabc")
13 d := NewDecoder(r)
14
15 size, err := d.Array()
16 assert.NoError(err)
17 assert.Equal(1, size)
18
19 bs, err := d.BulkString()
20 assert.NoError(err)
21 assert.Equal("hello", bs)
22}
23
24func TestArray_Encode(t *testing.T) {
25 assert := assert.New(t)

Callers

nothing calls this directly

Calls 3

ArrayMethod · 0.95
BulkStringMethod · 0.95
NewDecoderFunction · 0.85

Tested by

no test coverage detected