Created
September 17, 2014 16:50
-
-
Save anandkunal/5d81cf39d1bd848c4b61 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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