Ejemplo n.º 1
0
func (t *CacherSuite) TestSet(ch *C) {
	opts := cacher.Options{}
	opts.Engine = cacher.LOCALCACHE

	cacher.InitCache(opts)

	cacher.Set("a", []byte("b"))
}
Ejemplo n.º 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")
}
Ejemplo n.º 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)
}