Cache: add method to get a copy of the map
This commit is contained in:
Vendored
+7
@@ -31,6 +31,8 @@ func TestCache(t *testing.T) {
|
||||
|
||||
err := c.Set("a", "b")
|
||||
checkErr(err)
|
||||
err = c.Set("p", "q")
|
||||
checkErr(err)
|
||||
|
||||
val, err := c.Get("a")
|
||||
checkErr(err)
|
||||
@@ -38,6 +40,11 @@ func TestCache(t *testing.T) {
|
||||
log.Panicf("value %v", val)
|
||||
}
|
||||
|
||||
cc := c.Copy()
|
||||
if len(cc) != 2 {
|
||||
log.Panicf("expected 2 items")
|
||||
}
|
||||
|
||||
err = c.Delete("a")
|
||||
checkErr(err)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user