From d90c05296a48c04bb73a7eb50630fed049d984e1 Mon Sep 17 00:00:00 2001 From: bandl <1658002533@qq.com> Date: Sun, 28 Nov 2021 19:47:23 +0800 Subject: [PATCH] test(dao-stringx): update GetSet --- storage/dao/stringx_test.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/storage/dao/stringx_test.go b/storage/dao/stringx_test.go index 7cdc5b3..5d24a96 100644 --- a/storage/dao/stringx_test.go +++ b/storage/dao/stringx_test.go @@ -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) {