You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
594 B

package cache
import (
"testing"
"time"
)
func Test_MemcacheURI(t *testing.T) {
cache, err := New("memcache://memcache")
if err != nil {
t.Fatal("Error creating cache:", err)
}
if _, ok := cache.(*MemcacheCache); !ok {
t.Fatal("Cache is not instance of MemcacheCache")
}
}
func Test_MemcacheStoreGet(t *testing.T) {
cache, err := New("memcache://memcache")
if err != nil {
t.Fatal("Error creating cache:", err)
}
obj := "test"
cache.Set("test", obj, time.Minute)
var new string
cache.Get("test", &new)
if obj != new {
t.Fatal("Expected", obj, "got", new)
}
}