(t *testing.T)
| 73 | } |
| 74 | |
| 75 | func TestQueueGetNegative(t *testing.T) { |
| 76 | q := New() |
| 77 | |
| 78 | for i := 0; i < 1000; i++ { |
| 79 | q.Add(i) |
| 80 | for j := 1; j <= q.Length(); j++ { |
| 81 | if q.Get(-j).(int) != q.Length()-j { |
| 82 | t.Errorf("index %d doesn't contain %d", -j, q.Length()-j) |
| 83 | } |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | func TestQueueGetOutOfRangePanics(t *testing.T) { |
| 89 | q := New() |