mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-09 01:40:20 +08:00
Added command length tests for DECRBY command. Updated godoc comment for DecrBy embedded API method.
This commit is contained in:
@@ -2324,6 +2324,27 @@ func Test_Generic(t *testing.T) {
|
||||
expectedResponse: 3,
|
||||
expectedError: nil,
|
||||
},
|
||||
{
|
||||
name: "5. Command too short",
|
||||
key: "DecrByKey5",
|
||||
presetValue: nil,
|
||||
command: []resp.Value{resp.StringValue("DECRBY"), resp.StringValue("DecrByKey5")},
|
||||
expectedResponse: 0,
|
||||
expectedError: errors.New(constants.WrongArgsResponse),
|
||||
},
|
||||
{
|
||||
name: "6. Command too long",
|
||||
key: "DecrKey6",
|
||||
presetValue: nil,
|
||||
command: []resp.Value{
|
||||
resp.StringValue("DECRBY"),
|
||||
resp.StringValue("DecrKey6"),
|
||||
resp.StringValue("3"),
|
||||
resp.StringValue("extra_arg"),
|
||||
},
|
||||
expectedResponse: 0,
|
||||
expectedError: errors.New(constants.WrongArgsResponse),
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
Reference in New Issue
Block a user