ENH: Expand INCR command test suite with comprehensive edge cases
Image Attached
This PR significantly expands the test coverage for the INCR command. I've added several new test cases to ensure robustness and correct behavior under various scenarios.
New test cases include:
-
Increment to and from max int64 Tests behavior at the upper limit of int64 Ensures proper error handling when exceeding the limit
-
Increment from min int64 Verifies correct incrementing from the lower bound of int64
-
Increment non-integer values Checks error handling when attempting to increment floats, strings, and booleans
-
Increment non-existent key Ensures proper initialization and incrementing of previously non-existent keys
-
Increment string representing integers Tests correct handling of string-stored integer values
-
Increment with expiry Verifies behavior of INCR on keys with expiration times
Summary of Changes
- Added 6 new test cases to TestINCR function
- Expanded test scenarios to cover int64 limits, type checking, and expiration
- Improved test structure for better readability and maintenance
Thanks @lucifercr07 if there is any fix or anything else to do in this PR, let me know.
@vanshavenger build seems to be failing, please have a look and fix it.
Hey @lucifercr07 , integration test seems to be working locally. Check below screenshot.
In the Build Stage: it is failing at these places. but when i run integration test locally these get passed.
@vanshavenger I believe it's a flakiness issue, will look into it. Thanks.
json_test.go:925: assertion failed: {"a":"b","b":[{"a":2.2},{"a":5},{"a":"c"}]} (out string) != {"b":[{"a":2.2},{"a":5},{"a":"c"}],"a":"b"} (result string)
Sure @lucifercr07 , After that ig we can merge this
@JyotinderSingh @lucifercr07 is the issue fixed?
@vanshavenger thanks for contributing, merged.