fixes issue #425 (#438)

This commit is contained in:
Kevin Wan
2021-02-05 13:32:56 +08:00
committed by GitHub
parent 7b3c3de35e
commit b88ba14597
6 changed files with 32 additions and 17 deletions

View File

@@ -115,8 +115,8 @@ func TestCacheNode_TakeNotFound(t *testing.T) {
err = cn.Take(&str, "any", func(v interface{}) error {
return errTestNotFound
})
assert.Equal(t, errTestNotFound, err)
assert.Equal(t, errTestNotFound, cn.GetCache("any", &str))
assert.True(t, cn.IsNotFound(err))
assert.True(t, cn.IsNotFound(cn.GetCache("any", &str)))
val, err := store.Get("any")
assert.Nil(t, err)
assert.Equal(t, `*`, val)
@@ -125,8 +125,8 @@ func TestCacheNode_TakeNotFound(t *testing.T) {
err = cn.Take(&str, "any", func(v interface{}) error {
return nil
})
assert.Equal(t, errTestNotFound, err)
assert.Equal(t, errTestNotFound, cn.GetCache("any", &str))
assert.True(t, cn.IsNotFound(err))
assert.True(t, cn.IsNotFound(cn.GetCache("any", &str)))
store.Del("any")
var errDummy = errors.New("dummy")