MCPcopy Index your code
hub / github.com/dropbox/godropbox / TestAddOrGetSimple

Method TestAddOrGetSimple

lockstore/map_test.go:94–105  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

92}
93
94func (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.,

Callers

nothing calls this directly

Calls 2

AddOrGetMethod · 0.95
NewLockingMapFunction · 0.70

Tested by

no test coverage detected