test(dao-stringx): update GetSet

This commit is contained in:
bandl 2021-11-28 19:47:23 +08:00
parent 2a556a9db6
commit d90c05296a
1 changed files with 7 additions and 3 deletions

View File

@ -129,14 +129,18 @@ func TestDao_GetSet(t *testing.T) {
_, err := dao.Set(baseKey, "a")
require.NoError(t, err)
resp, err := dao.GetSet(baseKey, "a")
resp, err := dao.GetSet(baseKey, "ab")
require.NoError(t, err)
require.Equal(t, resp.Result, "a")
// TODO 这个测试有问题,等待修复,问题详情: https://gitee.com/wheat-os/wheat-cache/issues/I4IV41
resp, err = dao.GetSet(baseKey, "s")
require.NoError(t, err)
require.Equal(t, resp.Result, nil)
require.Equal(t, resp.Result, "a")
l := proto.NewBaseKey("l")
resp, err = dao.GetSet(l, "s")
require.NoError(t, err)
require.Equal(t, resp.Result, "")
}
func TestDao_StrLen(t *testing.T) {