(t *testing.T)
| 89 | } |
| 90 | |
| 91 | func 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 | |
| 111 | type loopReader struct { |
| 112 | buf []byte |
nothing calls this directly
no test coverage detected