예제 #1
0
func (t *CacherSuite) TestSet(ch *C) {
	opts := cacher.Options{}
	opts.Engine = cacher.LOCALCACHE

	cacher.InitCache(opts)

	cacher.Set("a", []byte("b"))
}
예제 #2
0
func (t *CacherSuite) TestGet(ch *C) {
	opts := cacher.Options{}
	opts.Engine = cacher.LOCALCACHE

	cacher.InitCache(opts)

	cacher.Set("c", []byte("d"))

	a := cacher.Get("c")

	ch.Assert(string(a), Equals, "d")
}
예제 #3
0
func (t *CacherSuite) TestDelete(ch *C) {
	opts := cacher.Options{}
	opts.Engine = cacher.LOCALCACHE

	cacher.InitCache(opts)

	cacher.Set("e", []byte("f"))

	cacher.Delete("e")

	a := cacher.Get("e")

	ch.Assert(len(a), Equals, 0)
}
예제 #4
0
func (t *CacherSuite) TestInit(ch *C) {
	opts := cacher.Options{}
	opts.Engine = cacher.LOCALCACHE

	cacher.InitCache(opts)
}