-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #14872: fix incorrectly handle with two-words redis command #14873
Changes from 1 commit
659fe8e
c54e746
fd6b939
0b4fe39
1be1f9c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,24 @@ func TestRedisParser_ArrayRequest(t *testing.T) { | |
assert.Equal(t, len(arrayRequest), msg.size) | ||
} | ||
|
||
var arrayRequest2 = []byte("*3\r\n" + | ||
"$6\r\n" + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the extra whitespace here is probably what's breaking the linter... can you run There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I get errors, would you please help me?
|
||
"CONFIG\r\n" + | ||
"$3\r\n" + | ||
"GET\r\n" + | ||
"$1\r\n" + | ||
"*\r\n") | ||
|
||
func TestRedisParser_ArrayRequest2(t *testing.T) { | ||
msg, ok, complete := parse(arrayRequest2) | ||
|
||
assert.True(t, ok) | ||
assert.True(t, complete) | ||
assert.True(t, msg.isRequest) | ||
assert.Equal(t, "CONFIG GET *", string(msg.message)) | ||
assert.Equal(t, len(arrayRequest2), msg.size) | ||
} | ||
|
||
var arrayResponse = []byte("*4\r\n" + | ||
"$3\r\n" + | ||
"foo\r\n" + | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like
p.message.method
andp.message.path
need to be computed differently as well to handle the two-word caseThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will have a look and test again.