Set and Get tests
Wrote a test file to address the issues listed in issue #69 and #71
- covers the correctness of single command
- covers the correctness when multiple commands are fired
- no commands are dropped abruptly
- ensure we check for small, large, and massive inputs
@JyotinderSingh what do you think about this?
@JyotinderSingh what do you think about this?
LGTM.
nit: I prefer to use the assert library for checks for consistency, but the PR is quite old so we can do that separately.
We can create a new branch from this branch and do the assertions by the assert lib. @ayo-ajayi 's commits will still stay and we can add the changes to master without compromising the code quality. Happy to take a stab at it.
We could also explore adding a linter check for future contributors so they will identify the concerns while pushing and will save dev and review time.
I can update the code to use the assert library for the tests if preferred. By assert library, do you mean: github.com/stretchr/testify/assert?
Thats awesome @ayo-ajayi . And welcome back!
You should usegotest.tools/v3/assert
Here is an example - https://github.com/DiceDB/dice/blob/master/tests/qwatch_test.go#L7
The test for retrieving a non-existent key (GET k_invalid) is not being executed correctly. While the command is encoded and sent, the DecodeOne function does not handle the null response returned by the database. This needs to be accounted for in the func (rp *RESPParser) DecodeOne() (interface{}, error) { implementation.
The test for retrieving a non-existent key (GET k_invalid) is not being executed correctly. While the command is encoded and sent, the DecodeOne function does not handle the
nullresponse returned by the database. This needs to be accounted for in thefunc (rp *RESPParser) DecodeOne() (interface{}, error) {implementation.
Please feel free to fix bugs in other components as a part of this PR
Hi @ayo-ajayi, are you still working on this PR?