Skip to content

Commit

Permalink
add test for last item in queue
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoferrer committed Oct 29, 2021
1 parent 01eba8e commit 13f3d7f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions limiter/lifo_blocking_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ func TestLifoQueue_Remove(t *testing.T) {
}
asrt.Equal(uint64(0), q.len())
asrt.Equal(7, len(seenElements))

q = lifoQueue{}
ctx = context.WithValue(context.Background(), testLifoQueueContextKey(1), 1)
q.push(ctx)

// Remove very last item leaving queue empty
q.remove(1)
asrt.Equal(uint64(0), q.len())
}

func TestLifoBlockingListener(t *testing.T) {
Expand Down

0 comments on commit 13f3d7f

Please sign in to comment.