(t *testing.T)
| 80 | } |
| 81 | |
| 82 | func TestClockTime(t *testing.T) { |
| 83 | data := []struct { |
| 84 | time int64 |
| 85 | }{ |
| 86 | {6000000000}, |
| 87 | {16666667}, |
| 88 | {33333333}, |
| 89 | {66666666}, |
| 90 | {60}, |
| 91 | } |
| 92 | for _, d := range data { |
| 93 | exp := float32(d.time) / 1000000000.0 |
| 94 | theTimer = testTime{0} |
| 95 | clock := NewClock() |
| 96 | theTimer = testTime{d.time} |
| 97 | if clock.Time() != exp { |
| 98 | t.Errorf("Clock's duration from Time() did not match %v seconds, was %v", exp, clock.Time()) |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | func TestTheTimerNow(t *testing.T) { |
| 104 | theTimer = realTime{} |