zrank_test.go
zrank_test.go - Overview
This file contains tests for the ZRANK
command in DiceDB. It verifies the command's behavior with different inputs and options, including existing and non-existing members, WITHSCORE
option, and error cases.
Detailed Documentation
TestZRANK(t *testing.T)
- Purpose: Tests the
ZRANK
command with various scenarios. - Parameters:
t
:*testing.T
- Testing object for running test cases.
- Returns: None.
Test Cases
The test cases are defined within the TestZRANK
function and cover scenarios such as:
ZRANK
of existing and non-existing members.ZRANK
with theWITHSCORE
option.ZRANK
on a non-existing key.ZRANK
with an incorrect number of arguments.ZRANK
with an invalid option.