diff --git a/v2/parser.go b/v2/parser.go index c04312ec..4591d899 100644 --- a/v2/parser.go +++ b/v2/parser.go @@ -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 diff --git a/v2/parser_test.go b/v2/parser_test.go deleted file mode 100644 index 0dee8e48..00000000 --- a/v2/parser_test.go +++ /dev/null @@ -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"}) -}