MCPcopy Index your code
hub / github.com/CodisLabs/codis / TestDecoder

Function TestDecoder

pkg/proxy/redis/decoder_test.go:91–109  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

89}
90
91func TestDecoder(t *testing.T) {
92 test := []string{
93 "$6\r\nfoobar\r\n",
94 "$0\r\n\r\n",
95 "$-1\r\n",
96 "*0\r\n",
97 "*2\r\n$3\r\nfoo\r\n$3\r\nbar\r\n",
98 "*3\r\n:1\r\n:2\r\n:3\r\n",
99 "*-1\r\n",
100 "+OK\r\n",
101 "-Error message\r\n",
102 "*2\r\n$1\r\n0\r\n*0\r\n",
103 "*3\r\n$4\r\nEVAL\r\n$31\r\nreturn {1,2,{3,'Hello World!'}}\r\n$1\r\n0\r\n",
104 }
105 for _, s := range test {
106 _, err := DecodeFromBytes([]byte(s))
107 assert.MustNoError(err)
108 }
109}
110
111type loopReader struct {
112 buf []byte

Callers

nothing calls this directly

Calls 1

DecodeFromBytesFunction · 0.85

Tested by

no test coverage detected