Adding tests for APPEND

This commit is contained in:
DMcP89
2024-07-02 14:08:17 -04:00
committed by Kelvin Mwinuka
parent 19dc8150eb
commit 4e0ab4e19a
3 changed files with 128 additions and 8 deletions
+16 -2
View File
@@ -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) {