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

Function TestDecodeSimpleRequest2

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

Source from the content-addressed store, hash-verified

53}
54
55func TestDecodeSimpleRequest2(t *testing.T) {
56 test := []string{
57 "hello world\r\n",
58 "hello world \r\n",
59 " hello world \r\n",
60 " hello world\r\n",
61 " hello world \r\n",
62 }
63 for _, s := range test {
64 a, err := DecodeMultiBulkFromBytes([]byte(s))
65 assert.MustNoError(err)
66 assert.Must(len(a) == 2)
67 assert.Must(bytes.Equal(a[0].Value, []byte("hello")))
68 assert.Must(bytes.Equal(a[1].Value, []byte("world")))
69 }
70}
71
72func TestDecodeSimpleRequest3(t *testing.T) {
73 test := []string{"\r", "\n", " \n"}

Callers

nothing calls this directly

Calls 1

DecodeMultiBulkFromBytesFunction · 0.85

Tested by

no test coverage detected