(c *C)
| 92 | } |
| 93 | |
| 94 | func (s *LockingMapSuite) TestAddOrGetSimple(c *C) { |
| 95 | l := NewLockingMap(defaultOptions) |
| 96 | |
| 97 | // Get non-existing |
| 98 | val, err := l.AddOrGet("test", simpleGetter) |
| 99 | c.Assert(val, Equals, "testfoo") |
| 100 | c.Assert(err, IsNil) |
| 101 | |
| 102 | val, err = l.AddOrGet("test", simpleGetter) |
| 103 | c.Assert(val, Equals, "testfoo") |
| 104 | c.Assert(err, IsNil) |
| 105 | } |
| 106 | |
| 107 | // runWithTimeout attempts to run a function for a given time and returns the value |
| 108 | // that the function returned plus a bool for whether or not the function ran (i.e., |
nothing calls this directly
no test coverage detected