Add old endpoint cleanup function

This commit is contained in:
Daniel Smith
2015-04-24 14:16:27 -07:00
parent 221553b147
commit b49dd0ad1e
4 changed files with 88 additions and 0 deletions

View File

@@ -113,3 +113,19 @@ func TestAddWhileProcessing(t *testing.T) {
q.ShutDown()
consumerWG.Wait()
}
func TestLen(t *testing.T) {
q := workqueue.New()
q.Add("foo")
if e, a := 1, q.Len(); e != a {
t.Errorf("Expected %v, got %v", e, a)
}
q.Add("bar")
if e, a := 2, q.Len(); e != a {
t.Errorf("Expected %v, got %v", e, a)
}
q.Add("foo") // should not increase the queue length.
if e, a := 2, q.Len(); e != a {
t.Errorf("Expected %v, got %v", e, a)
}
}