Skip to content

Instantly share code, notes, and snippets.

@anandkunal
Created September 17, 2014 16:50
Show Gist options
  • Save anandkunal/5d81cf39d1bd848c4b61 to your computer and use it in GitHub Desktop.
Save anandkunal/5d81cf39d1bd848c4b61 to your computer and use it in GitHub Desktop.
func TestColdGet(t *testing.T) {
item, _ := c.Get(cacheItem.Key)
if item != nil {
t.Errorf("Cache key should not exist: %s\n", cacheItem.Key)
}
}
func TestPut(t *testing.T) {
_, err := c.Put(cacheItem)
if err != nil {
t.Error(err)
}
}
func TestWarmGet(t *testing.T) {
item, _ := c.Get(cacheItem.Key)
if item == nil {
t.Errorf("Cache key should exist: %s\n", cacheItem.Key)
}
if item.Value != cacheItem.Value {
t.Errorf("Cache value expected %s got %s\n", cacheItem.Value, item.Value)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment