(t *testing.T)
| 57 | } |
| 58 | |
| 59 | func TestQueue(t *testing.T) { |
| 60 | for iter := 0; iter < 100; iter++ { |
| 61 | now := time.Date(2015, 1, 1, 0, 0, 0, 0, time.UTC) |
| 62 | queue := populateQueue(t, now) |
| 63 | |
| 64 | // Make sure objects are removed from the queue in order. |
| 65 | for prev := now; queue.Len() > 0; { |
| 66 | _, ptm := queue.PeekFirst() |
| 67 | _, tm := queue.PopFirst() |
| 68 | if tm != ptm { |
| 69 | t.Errorf("Peek/Pop mismatch.\n") |
| 70 | } |
| 71 | if tm.Sub(prev) != time.Hour { |
| 72 | t.Errorf("Invalid queue ordering.\n"+ |
| 73 | " Got: %v\n"+ |
| 74 | "Expected: %v\n", tm, prev.Add(time.Hour)) |
| 75 | } |
| 76 | prev = tm |
| 77 | } |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | func TestAdvance(t *testing.T) { |
| 82 | for iter := 0; iter < 100; iter++ { |
nothing calls this directly
no test coverage detected