Adding tests for APPEND

This commit is contained in:
DMcP89
2024-07-02 14:08:17 -04:00
parent fca160c590
commit 26224f1d1a
4 changed files with 3580 additions and 3443 deletions

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) {