diff --git a/big_cache_test.go b/big_cache_test.go deleted file mode 100644 index 1381b89..0000000 --- a/big_cache_test.go +++ /dev/null @@ -1,26 +0,0 @@ -package gocache - -import ( - "testing" - "time" -) - -func TestBigCache(t *testing.T) { - - // 实例 - newBig := NewBig(time.Minute * 30) - - // 结构体 - type name struct { - Test string `json:"test"` - } - - // 缓存组件 - newBigCache := newBig.NewCache() - newBigCache.GetterInterface = func() interface{} { - return name{"测试Big插入数据3"} - } - key3 := newBigCache.GetInterface("key3") - t.Logf("key3:%+v", key3) - -} diff --git a/big_test.go b/big_test.go index f1715a8..cdceb89 100644 --- a/big_test.go +++ b/big_test.go @@ -7,7 +7,6 @@ import ( func TestBig(t *testing.T) { - // 实例 newBig := NewBig(time.Minute * 30) // 字符串 @@ -23,4 +22,12 @@ func TestBig(t *testing.T) { key2, _ := newBig.Get("key2") t.Logf("key2:%+v", key2) + // 缓存组件 + newBigCache := newBig.NewCache() + newBigCache.GetterInterface = func() interface{} { + return name{"测试Big插入数据3"} + } + key3 := newBigCache.GetInterface("key3") + t.Logf("key3:%+v", key3) + } diff --git a/go_cache_test.go b/go_cache_test.go deleted file mode 100644 index 2c6b890..0000000 --- a/go_cache_test.go +++ /dev/null @@ -1,25 +0,0 @@ -package gocache - -import ( - "testing" - "time" -) - -func TestGoCache(t *testing.T) { - - // 实例 - newGo := NewGo(5*time.Minute, 10*time.Minute) - - // 结构体 - type name struct { - Test string `json:"test"` - } - // 缓存组件 - bigCache := newGo.NewCache(5 * time.Minute) - bigCache.GetterInterface = func() interface{} { - return name{"测试Go插入数据3"} - } - key3 := bigCache.GetInterface("key3") - t.Logf("key3:%+v", key3) - -} diff --git a/go_test.go b/go_test.go index 332367a..690997e 100644 --- a/go_test.go +++ b/go_test.go @@ -7,7 +7,6 @@ import ( func TestGo(t *testing.T) { - // 实例 newGo := NewGo(5*time.Minute, 10*time.Minute) // 字符串 @@ -23,4 +22,12 @@ func TestGo(t *testing.T) { key2, _ := newGo.Get("key2") t.Logf("key2:%+v", key2) + // 缓存组件 + bigCache := newGo.NewCache(5 * time.Minute) + bigCache.GetterInterface = func() interface{} { + return name{"测试Go插入数据3"} + } + key3 := bigCache.GetInterface("key3") + t.Logf("key3:%+v", key3) + }