Unexport ParseReq.

This commit is contained in:
Vladimir Mihailenco 2013-07-02 14:26:00 +03:00
parent d1b0bd004c
commit 28a881e724
2 changed files with 1 additions and 24 deletions

View File

@ -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) line, err := readLine(rd)
if err != nil { if err != nil {
return nil, err return nil, err

View File

@ -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"})
}