Add poller to cache.

This commit is contained in:
Daniel Smith
2014-08-18 14:47:20 -07:00
parent dddad888b5
commit 4c4ca59050
7 changed files with 290 additions and 48 deletions

View File

@@ -40,10 +40,12 @@ func doTestStore(t *testing.T, store Store) {
t.Errorf("expected %v, got %v", e, a)
}
}
store.Delete("foo", "qux")
store.Delete("foo")
if _, ok := store.Get("foo"); ok {
t.Errorf("found deleted item??")
}
// Test List
store.Add("a", "b")
store.Add("c", "d")
store.Add("e", "e")
@@ -57,6 +59,15 @@ func doTestStore(t *testing.T, store Store) {
if len(found) != 3 {
t.Errorf("extra items")
}
// Check that ID list is correct.
ids := store.Contains()
if !ids.HasAll("a", "c", "e") {
t.Errorf("missing items")
}
if len(ids) != 3 {
t.Errorf("extra items")
}
}
func TestCache(t *testing.T) {