MCPcopy Create free account
hub / github.com/git-bug/git-bug / testClock

Function testClock

util/lamport/clock_testing.go:9–28  ·  view source on GitHub ↗
(t *testing.T, c Clock)

Source from the content-addressed store, hash-verified

7)
8
9func testClock(t *testing.T, c Clock) {
10 assert.Equal(t, Time(1), c.Time())
11
12 val, err := c.Increment()
13 assert.NoError(t, err)
14 assert.Equal(t, Time(2), val)
15 assert.Equal(t, Time(2), c.Time())
16
17 err = c.Witness(42)
18 assert.NoError(t, err)
19 assert.Equal(t, Time(42), c.Time())
20
21 err = c.Witness(42)
22 assert.NoError(t, err)
23 assert.Equal(t, Time(42), c.Time())
24
25 err = c.Witness(30)
26 assert.NoError(t, err)
27 assert.Equal(t, Time(42), c.Time())
28}

Callers 2

TestMemClockFunction · 0.85
TestPersistedClockFunction · 0.85

Calls 4

TimeTypeAlias · 0.70
TimeMethod · 0.65
IncrementMethod · 0.65
WitnessMethod · 0.65

Tested by 2

TestMemClockFunction · 0.68
TestPersistedClockFunction · 0.68