(t *testing.T)
| 115 | } |
| 116 | |
| 117 | func TestLen(t *testing.T) { |
| 118 | q := workqueue.New() |
| 119 | q.Add("foo") |
| 120 | if e, a := 1, q.Len(); e != a { |
| 121 | t.Errorf("Expected %v, got %v", e, a) |
| 122 | } |
| 123 | q.Add("bar") |
| 124 | if e, a := 2, q.Len(); e != a { |
| 125 | t.Errorf("Expected %v, got %v", e, a) |
| 126 | } |
| 127 | q.Add("foo") // should not increase the queue length. |
| 128 | if e, a := 2, q.Len(); e != a { |
| 129 | t.Errorf("Expected %v, got %v", e, a) |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | func TestReinsert(t *testing.T) { |
| 134 | q := workqueue.New() |