test(dao): add set test dao

This commit is contained in:
bandl 2021-10-17 10:50:13 +08:00
parent d6f1631d7b
commit d963c06576
1 changed files with 24 additions and 0 deletions

24
storage/dao/dao_test.go Normal file
View File

@ -0,0 +1,24 @@
package dao
import (
"testing"
_ "gitee.com/timedb/wheatCache/conf"
"gitee.com/timedb/wheatCache/pkg/logx"
"gitee.com/timedb/wheatCache/pkg/lru"
"gitee.com/timedb/wheatCache/pkg/proto"
"github.com/stretchr/testify/require"
)
func TestDao_Set(t *testing.T) {
lruCache := lru.NewLRUCache()
dao := NewDao(lruCache)
key := &proto.BaseKey{
Key: "abc",
}
res, err := dao.Get(key)
require.Error(t, err)
logx.Infoln(res)
}