(t *testing.T)
| 16 | } |
| 17 | |
| 18 | func TestClockTick(t *testing.T) { |
| 19 | theTimer = testTime{0} |
| 20 | clock := NewClock() |
| 21 | before := clock.counter |
| 22 | clock.Tick() |
| 23 | after := clock.counter |
| 24 | if after != before+1 { |
| 25 | t.Errorf("Tick did not increase the counter, before: %v, after: %v", before, after) |
| 26 | } |
| 27 | theTimer = testTime{1000000000} |
| 28 | clock.Tick() |
| 29 | if clock.counter != 0 { |
| 30 | t.Error("Clock's count did not reset to 0 after waiting over 1 second") |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | func TestClockFPS(t *testing.T) { |
| 35 | data := []struct { |