(t *testing.T)
| 58 | } |
| 59 | |
| 60 | func TestClockDelta(t *testing.T) { |
| 61 | data := []struct { |
| 62 | delta int64 |
| 63 | }{ |
| 64 | {6000000000}, |
| 65 | {16666667}, |
| 66 | {33333333}, |
| 67 | {66666666}, |
| 68 | {60}, |
| 69 | } |
| 70 | for _, d := range data { |
| 71 | exp := float32(d.delta) / 1000000000.0 |
| 72 | theTimer = testTime{0} |
| 73 | clock := NewClock() |
| 74 | theTimer = testTime{d.delta} |
| 75 | clock.Tick() |
| 76 | if clock.Delta() != exp { |
| 77 | t.Errorf("Clock's Delta did not match %v, was %v", exp, clock.Delta()) |
| 78 | } |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | func TestClockTime(t *testing.T) { |
| 83 | data := []struct { |