forked from mirror/redis
Unexport ParseReq.
This commit is contained in:
parent
d1b0bd004c
commit
28a881e724
|
@ -100,7 +100,7 @@ func readN(rd reader, n int) ([]byte, error) {
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
func ParseReq(rd reader) ([]string, error) {
|
||||
func parseReq(rd reader) ([]string, error) {
|
||||
line, err := readLine(rd)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
package redis_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"github.com/vmihailenco/bufio"
|
||||
. "launchpad.net/gocheck"
|
||||
|
||||
"github.com/vmihailenco/redis/v2"
|
||||
)
|
||||
|
||||
type ParserTest struct{}
|
||||
|
||||
var _ = Suite(&ParserTest{})
|
||||
|
||||
func (t *ParserTest) TestParseReq(c *C) {
|
||||
buf := bytes.NewBufferString("*3\r\n$3\r\nSET\r\n$3\r\nkey\r\n$5\r\nhello\r\n")
|
||||
rd := bufio.NewReaderSize(buf, 1024)
|
||||
|
||||
args, err := redis.ParseReq(rd)
|
||||
c.Check(err, IsNil)
|
||||
c.Check(args, DeepEquals, []string{"SET", "key", "hello"})
|
||||
}
|
Loading…
Reference in New Issue