MCPcopy Create free account
hub / github.com/Shopify/goose / TestStateTracker_Set

Function TestStateTracker_Set

statetracker/tracker_test.go:13–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestStateTracker_Set(t *testing.T) {
14 tracker := New(false)
15
16 // Default
17 assert.False(t, tracker.Get().(bool))
18 // Very small for now, but should still be non-zero
19 assert.True(t, tracker.Duration(false, true) > 0)
20
21 // Still false
22 tracker.Set(false)
23 assert.False(t, tracker.Get().(bool))
24
25 // Now true
26 tracker.Set(true)
27 assert.True(t, tracker.Get().(bool))
28 assert.True(t, tracker.Duration(false, true) == 0)
29}
30
31func TestStateTracker_Wait(t *testing.T) {
32 tracker := New(false)

Callers

nothing calls this directly

Calls 4

NewFunction · 0.70
GetMethod · 0.65
DurationMethod · 0.65
SetMethod · 0.65

Tested by

no test coverage detected