forked from p53841790/wheat-cache
test(dao-stringx): update GetSet
This commit is contained in:
parent
2a556a9db6
commit
d90c05296a
|
@ -129,14 +129,18 @@ func TestDao_GetSet(t *testing.T) {
|
||||||
|
|
||||||
_, err := dao.Set(baseKey, "a")
|
_, err := dao.Set(baseKey, "a")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
resp, err := dao.GetSet(baseKey, "a")
|
resp, err := dao.GetSet(baseKey, "ab")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, resp.Result, "a")
|
require.Equal(t, resp.Result, "a")
|
||||||
|
|
||||||
// TODO 这个测试有问题,等待修复,问题详情: https://gitee.com/wheat-os/wheat-cache/issues/I4IV41
|
|
||||||
resp, err = dao.GetSet(baseKey, "s")
|
resp, err = dao.GetSet(baseKey, "s")
|
||||||
require.NoError(t, err)
|
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) {
|
func TestDao_StrLen(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue