-
Notifications
You must be signed in to change notification settings - Fork 592
fix(zset): wrong RESP reply in ZRANDMEMBER and ZMSCORE command #2937
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
Conversation
@weim0000 You could add test cases in zset_test.go |
In golang test cases, we start a kvrocks instance and connect it via go-redis client library. So that these RESP replies can be tested well. No need to add a test file for cmd_xx.cc. |
| createZset(rdb, ctx, "zset", z) | ||
|
|
||
| // ZRANDMEMBER zset | ||
| str := rdb.Do(ctx, "ZRANDMEMBER", "zset").Val() |
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.
Can use rdb.ZRandMember.
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.
Seems not a major issue, maybe we can merge it first.
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.
Sorry, it can't use rdb.ZRandMember, because this function have a count param,
ZRandMember(ctx context.Context, key string, count int);
and this bug must not input count param;
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.
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.
I see, thank you!
|




I want to add some test case for commandzmscore and commandzrandmember, but I cloud not find any folder or file to test commandXXX.
after fix: