MCPcopy
hub / github.com/EngoEngine/engo / TestClockPause

Function TestClockPause

clock_test.go:111–131  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

109}
110
111func TestClockPause(t *testing.T) {
112 clock := NewClock()
113 wait := time.NewTicker(time.Second / 100)
114 clock.Tick()
115 <-wait.C
116 clock.Tick()
117 if clock.Delta() <= 0 {
118 t.Error("Clock did not increase delta after wait")
119 }
120 clock.Pause()
121 if clock.Delta() != 0 {
122 t.Error("Clock did not pause!")
123 }
124 clock.Unpause()
125 clock.Tick()
126 <-wait.C
127 clock.Tick()
128 if clock.Delta() <= 0 {
129 t.Error("Clock did not increase delta after unpausing")
130 }
131}

Callers

nothing calls this directly

Calls 6

TickMethod · 0.95
DeltaMethod · 0.95
PauseMethod · 0.95
UnpauseMethod · 0.95
NewClockFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected