(t *testing.T)
| 3 | import "testing" |
| 4 | |
| 5 | func TestQueueSimple(t *testing.T) { |
| 6 | q := New() |
| 7 | |
| 8 | for i := 0; i < minQueueLen; i++ { |
| 9 | q.Add(i) |
| 10 | } |
| 11 | for i := 0; i < minQueueLen; i++ { |
| 12 | if q.Peek().(int) != i { |
| 13 | t.Error("peek", i, "had value", q.Peek()) |
| 14 | } |
| 15 | x := q.Remove() |
| 16 | if x != i { |
| 17 | t.Error("remove", i, "had value", x) |
| 18 | } |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | func TestQueueWrapping(t *testing.T) { |
| 23 | q := New() |