mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-24 00:14:08 +08:00
Adding tests for APPEND
This commit is contained in:
@@ -323,13 +323,27 @@ func TestEchoVault_APPEND(t *testing.T) {
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: "Return the correct string length for appended value",
|
||||
name: "Test APPEND with no preset value",
|
||||
key: "key1",
|
||||
value: "Hello ",
|
||||
want: 6,
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "Test APPEND with preset value",
|
||||
presetValue: "Hello ",
|
||||
key: "key1",
|
||||
key: "key2",
|
||||
value: "World",
|
||||
want: 11,
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "Test APPEND with integer preset value",
|
||||
key: "key3",
|
||||
presetValue: 10,
|
||||
value: "Hello ",
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user