func TestMultipleHandlers(t *testing.T) { r := &request.Request{} l := request.HandlerList{} l.PushBack(func(r *request.Request) { r.Data = nil }) l.PushFront(func(r *request.Request) { r.Data = aws.Bool(true) }) l.Run(r) if r.Data != nil { t.Error("Expected handler to execute") } }
func TestHandlerList(t *testing.T) { s := "" r := &request.Request{} l := request.HandlerList{} l.PushBack(func(r *request.Request) { s += "a" r.Data = s }) l.Run(r) assert.Equal(t, "a", s) assert.Equal(t, "a", r.Data) }