"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "internal/pqueue/pqueue_test.go" between
nsq-1.2.0.tar.gz and nsq-1.2.1.tar.gz

About: nsq is a realtime distributed and and decentralized messaging platform.

pqueue_test.go  (nsq-1.2.0):pqueue_test.go  (nsq-1.2.1)
skipping to change at line 52 skipping to change at line 52
ints := make([]int, 0, c) ints := make([]int, 0, c)
for i := 0; i < c; i++ { for i := 0; i < c; i++ {
v := rand.Int() v := rand.Int()
ints = append(ints, v) ints = append(ints, v)
heap.Push(&pq, &Item{Value: i, Priority: int64(v)}) heap.Push(&pq, &Item{Value: i, Priority: int64(v)})
} }
equal(t, pq.Len(), c) equal(t, pq.Len(), c)
equal(t, cap(pq), c) equal(t, cap(pq), c)
sort.Sort(sort.IntSlice(ints)) sort.Ints(ints)
for i := 0; i < c; i++ { for i := 0; i < c; i++ {
item, _ := pq.PeekAndShift(int64(ints[len(ints)-1])) item, _ := pq.PeekAndShift(int64(ints[len(ints)-1]))
equal(t, item.Priority, int64(ints[i])) equal(t, item.Priority, int64(ints[i]))
} }
} }
func TestRemove(t *testing.T) { func TestRemove(t *testing.T) {
c := 100 c := 100
pq := New(c) pq := New(c)
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)